Jump to content
hfr

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

Share this post


Link to post
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.

 

Share this post


Link to post
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.

 

Share this post


Link to post
50 minutes ago, deanishe said:

Looks good, but no icon?

… give me a break. ;)

This morning I had to google "osascript", not knowing what it was. I'll get into painting icons later this week.

Edited by hfr

Share this post


Link to post

@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

Share this post


Link to post
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 :-)

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...