Jump to content

Using selected text as input, possible?


Recommended Posts

I noticed the only way to operate on the currently selected text is to have a Hotkey defined.

Most of the time I want to operate on the text but not actually have a hotkey.

 

IE. Highlight text

Bring up alfred

Type in my Command

The command uses the highlighted text

 

is this possible?

Link to post

This is not possible (with the current feature set, at least), because the way Alfred gets the selected text is by copying it to your clipboard. When you call Alfred to type your hotkey, copying will no longer work on what you want, since Alfred will be on top.

 

You might be able to do this if you get creative, by telling Alfred to switch to the previous frontmost app, copy, and then return, or something like that. With browsers you might even be able to do it easier. But to make an app-agnostic way, you’ll likely have a hard time.


Your best best is o make your Alfred Keyword act on your clipboard. You then copy your text before actioning it.

Link to post

@Overload119 The easiest way to achieve this at a generic level is to have a single separate hotkey defined to show Alfred with the currently selected text in macOS, and place the cursor to the left.

 

i.e. my Alfred hotkey is alt+space, but I have ctrl+alt+space (workflow hotkey trigger by itself) setup as the following, which puts Alfred in a state (cursor to the left) ready for me to type the keyword:

 

Screen Shot 2017-01-24 at 19.19.08.png

 

This way, you only need to remember two hotkeys - One for Alfred by default, and one for Alfred with selected text.

 

Cheers,

Andrew

Link to post

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