Update: You do not need to use the command line to achieve this effect!
Simply make a keyboard shortcut through the GUI with the name of the application as you see it in the menu.
Sorry for any confusion this may have incurred.
I've mentioned the application Spark before as a way of launching an application through a keyboard shortcut. What I didn't know is that you don't need a 3rd party application to do that. As it turns out, you can easily do this with keyboard shortcuts through the command line.
What you need to do is go to the Recent Items submenu in the menu. Find the exact name of the application you want to launch with a keyboard shortcut. Then, use this template terminal command to make the terminal code you'll enter in:defaults write NSGlobalDomain NSUserKeyEquivalents '{"App_name"="keyboard_shortcut";}'
Replace the App_name with the name you got from the menu. Replace the keyboard_shortcut with the keyboard shortcut you want. Here's the equivalents:
@ = Cmd
~ = Option
^ = Ctrl
$ = Shift
So, to add Cmd-Option-Shift-M to launch Mail.app, I would use:defaults write NSGlobalDomain NSUserKeyEquivalents '{"Mail.app"="@~$m";}'
As a final note, if you don't use the recent items menu for anything, then you can go to the Appearance preference pane and change the number of items to 50. This way, the app is practically guaranteed to be in the list.
3/18/08
Add Keyboard Shortcuts for Applications
Posted by
MacTipper
at
Tuesday, March 18, 2008
Labels: Keyboard Shortcut, Terminal
Subscribe to:
Post Comments (Atom)


0 comments:
Post a Comment