Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How do I program my Mac's F19 key to automatically type a text when I press it?

share|improve this question

You could also create ~/Library/KeyBindings/ and save a property list like this as DefaultKeyBinding.dict.

    "\UF716" = (insertText:, "test");

Applications have to be reopened to apply changes. For more information, see or

share|improve this answer

If you want to use any keyboard shortcut, with built-in methods …

Open up and create a new Service. Set it to receive no input and drag Run AppleScript from the left pane to the right.

Enter this script:

tell application "System Events"
    keystroke ""
end tell

Save the service under any name you like. Normally, you'd assign shortcuts to services by going to System Preferences » Keyboard » Keyboard Shortcuts. Here, you can assign (almost) any key combination.

However, in OS X 10.6, there's a bug that won't let you assign a service to an F-key. See the second option in my answer on how to overcome that. In 10.7 it seems to work though.

If you want to use third-party software …

Open up AppleScript and paste the script from above. Save it under ~/Library/Scripts. You need to create this folder before if it doesn't exist. If your Library is hidden, in Finder press CmdShiftG and enter ~/Library to view it.

Then, after you've saved the script, you can install FastScripts and bind that script to F19 (or whatever you like).

enter image description here

share|improve this answer
10.7.4 seems to allow using just F-keys as shortcuts for services. – user495470 Jun 24 '12 at 16:18
Good to know they've resolved this. – slhck Jun 24 '12 at 16:23

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.