Jump to content

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


Recommended Posts

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

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