Jump to content

Running applescript to strip text formatting


Recommended Posts

So I have this applescript which works well when I run it in AppleScript Editor:

 
set the clipboard to (get the clipboard as text)

 

However when I create a new Alfred workflow and run it, it doesn't seem to do anything.

 

I'm using Workflows > Add > Templates > Essentials > Keyword to Script

Then Language: /usr/bin/osascript

All escaping turned off

 

Any help getting this to work? Thanks!

Link to comment

So I have this applescript which works well when I run it in AppleScript Editor:

 

 
set the clipboard to (get the clipboard as text)

 

However when I create a new Alfred workflow and run it, it doesn't seem to do anything.

 

I'm using Workflows > Add > Templates > Essentials > Keyword to Script

Then Language: /usr/bin/osascript

All escaping turned off

 

Any help getting this to work? Thanks!

 

Were you able to figure this out? I took your exact code, stuck it in AppleScript Editor and it seems to work perfectly. I then created an Alfred workflow with a hotkey AND a keyword. Both seem to work. By not working did you mean that when you selected the hotkey that Alfred stayed visible and it added a space to the end? The keyword may have still been set to require a parameter and so Alfred was sitting waiting for that. If you double click the Keyword module and set it to receive no parameter, this should work perfectly.

 

Also, may I suggest for this that you add a Copy to Clipboard output. Connect it behind the script, and in the text box of the Clipboard module enter {query}, and select the "Automatically paste into front most app". That will make it so that you just select text, hit your keyword, and it strips formatting and pastes it back wherever you are automatically.

Link to comment
  • 3 months later...

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...