Jump to content

Passing foreground selected text to Run Script


Recommended Posts

Hi,

 

I'm looking to build a "pipe" workflow which will fire on hotkey, taking the currently selected text in the foreground application, allow you to specify a shell pipe to pass the text through, then copy the result to the clipboard. I've already got a hack-ish workflow for this:

 

Keyword (| with space, Argument Required)

=>

Run Script (/bin/zsh) {

  pbpaste | {query} | pbcopy

}

 

It would be nice to be able to set a hotkey though (as things stand, I have to choose between passing the selected text to the Run Script or being able to enter the command), and ideally it should be possible to to pass the foreground selected text in to a Run Script or Script Filter in another token, thus saving the requirement to initially copy the text to the clipboard. I would suggest a new "Selected Text" Input with a token named {selected}.

 

There are various other ways this would be useful, e.g. "Mail selected text to…"

 

Thoughts?

 

Robin

Edited by isometry
Link to comment

Hi,

 

I'm looking to build a "pipe" workflow which will fire on hotkey, taking the currently selected text in the foreground application, allow you to specify a shell pipe to pass the text through, then copy the result to the clipboard. I've already got a hack-ish workflow for this:

 

Keyword (| with space, Argument Required)

=>

Run Script (/bin/zsh) {

  pbpaste | {query} | pbcopy

}

 

It would be nice to be able to set a hotkey though (as things stand, I have to choose between passing the selected text to the Run Script or being able to enter the command), and ideally it should be possible to to pass the foreground selected text in to a Run Script or Script Filter in another token, thus saving the requirement to initially copy the text to the clipboard. I would suggest a new "Selected Text" Input with a token named {selected}.

 

There are various other ways this would be useful, e.g. "Mail selected text to…"

 

Thoughts?

 

Robin

 

Hey man, sorry but I'm having kind of a hard time following what exactly it is that your looking for. Can you clarify this a little for me so I can try to help you out?

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