Jump to content

How to make Alfred type (not paste) a preset text with a hotkey?


Recommended Posts

Posted

How can I make Alfred type (not paste) a preset text with a hotkey?

 

For example, if I press Command + F6 (the hot key) I want the text "myemail@xyz.com" to be typed where the curser is in the front most app.

Posted

How can I make Alfred type (not paste) a preset text with a hotkey?

 

For example, if I press Command + F6 (the hot key) I want the text "myemail@xyz.com" to be typed where the curser is in the front most app.

 

I believe the only way to accomplish this without performing a paste is to use AppleScript. So, that being said, you would create a workflow with a hotkey trigger, and connect it to a Run Script (with language set to osascript) or a Run NSAppleScript. In the code area, use something like this..

tell application "System Events"
    keystroke "myemail@xyz.com"
end tell

Obviously, you would replace the stuff in quotes with what you want the expansion to be

  • 3 months later...
Posted

Thanks, I think I figured it out. In the workflow area of Alfred I hit the + and chose a clipboard template. It's two items were able to get it done (hotkey and copy to clip). Now for example every time I press Apple + 6 my computer automatically types my email address. 

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