Jump to content

Copy selection as pure plaintext


Recommended Posts

Hi, I sometimes ran into the problem that there still was some formatting (e.g. URLs) in my clipboard even though I pasted it as plaintext. With this tiny script, there will be nothing but plaintext left. Have fun.

 

Download

Source

 

I linked it to Command+Option+Shift+C (equivalent to paste as plaintext). Saves me time every day.

 

(I'm new to this, please tell me if I misbehaved in any way)

Edited by hfr
Link to comment
3 hours ago, hfr said:

tell me if I misbehaved in any way

 

One thing that we generally recommend: put the workflow source code on GitHub, not just the exported workflow. It makes it much easier for other people to contribute via Pull Requests.

 

Link to comment
31 minutes ago, hfr said:

 

No, not really. I mean the whole workflow (i.e. info.plist, icon.png etc.). Basically the contents of the folder you see when you right-click on your workflow in Alfred Preferences and choose Open in Finder.

 

That should be the root directory or a subdirectory of your repo. That way, people can install the workflow via git clone (plus possibly symlinking it), and submit meaningful pull requests.

 

For example, when possible, I keep the "finished" workflow in a src directory of the repo. I can symlink that directory to Alfred's workflow directory to use the workflow, and other folks can submit pull requests against the full source code rather than submitting an impenetrable binary (the .alfredworkflow file).

 

I keep the actual workflow source in a subdirectory because there's a copy of the compiled workflow in the root. Putting the workflow and the source in the root often leads to people exporting a workflow with a copy of the previous version in it, which has a copy of the version before that in it, etc. etc.

 

Link to comment

@hfr Take a look at Alfred's built-in workflows by going to the Workflows tab, clicking on the [+] at the bottom of the sidebar, and choosing Templates > Clipboard > Paste as plain text from hotkey. All you need to do is set your hotkey!

 

This workflow should do what you need, just in case you prefer to use the built-in option :)

 

Cheers,
Vero

Link to comment
  • 1 year later...
Quote

@hfr Take a look at Alfred's built-in workflows by going to the Workflows tab, clicking on the [+] at the bottom of the sidebar, and choosing Templates > Clipboard > Paste as plain text from hotkey. All you need to do is set your hotkey!

@Vero There is even a simpler solution to this, if you have activated Clipboard > Clipboard History > Keep Plain Text, then assign a Viewer Hotkey. All you have to do then is cmd-c a richtext and then use the clipboard history viewer hotkey and select the most recent entry to paste the plaintext :-)

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...