Mac OS 10.6 has a "Keyboard Shortcuts" preference pane in System Preferences. It lets you add new entries, but they don't seem to work. Is this the correct way to add hotkeys? For instance I would like Command+Esc to open Terminal.app.

link|improve this question

73% accept rate
As Daniel points out, you may want to look at something like Alfred.app or Quicksilver, or Google’s QSB project. – peelman Feb 14 '11 at 16:06
I use and love Alfred, but you can also launch using Spotlight. If you're using Terminal often enough (or at least fewer than other apps starting with "T"), it might be as few as 3 keystrokes -- one to launch spotlight, one to enter "T", one to hit return to accept the first result found. – Doug Harris Feb 14 '11 at 16:28
No need to repeat someone else's suggestion guys. Please leave comments for new information. I like alfred too, but I'm not asking about launchers. – Ross Charette Feb 15 '11 at 17:51
feedback

2 Answers

up vote 3 down vote accepted

You have to deal with two issues here

  • You can only assign keyboard shortcuts to applications' menu items and services. Terminal.app is neither.
  • You cannot usually create a keyboard shortcut using Esc for Services in System Preferences » Keyboard » Keyboard Shortcuts.

Make sure a real application launcher such as Quicksilver, Alfred or LaunchBar wouldn't be the better solution.

For a Terminal, have a look at Visor. It allows you to create a HUD console. If you played Quake, you know how it works.


That being said, you can make this work.

First, create a Service by starting /Applications/Automator.app and select the Service template. Select the Utilities library and double-click Launch Application. Select Other... from the popu-menu and then select /Applications/Utilities/Terminal.app.

Above the Launch Application command, select no input and any application.

Press Command-S to save, and name it Launch Terminal.


Now, Open System Preferences » Keyboard » Keyboard Shortcuts, select Application Shortcuts (not Services!). Click the + button, and select All Applications. As name, type Launch Terminal. Then, select the keyboard shortcut input field and press Command-Esc. Click Add.

Done. Now there's a new menu item in Application Menu » Services named Launch Terminal, with the keyboard shortcut Command-Esc, and selecting it starts Terminal.

enter image description here

link|improve this answer
A brillant hack :) – peelman Feb 14 '11 at 16:07
I'm pretty sure Cmd-Esc is used by some applications. Might be connected to the Esc autocompletion. I could be wrong though. – Daniel Beck Feb 14 '11 at 16:18
I so wanted this to work, but the keyboard shortcut still doesn't launch terminal. I can select it from the menu, but that defeats the purpose of having a shortcut. (Daniel, yes front row uses that shortcut by default, which you can disable in the keyboard prefs) – Ross Charette Feb 15 '11 at 17:47
@Ross It works for me with the shortcut. Could you try it with a new user account, maybe some background process interferes? You also should know that you need to change the active application once before the Services menu gets updated. – Daniel Beck Feb 15 '11 at 18:07
Rebooted, and this is what I've found. The shortcuts don't work right out of the gate. But if you go to the App menu > services they appear. This seems to 'refresh' or activate the service. After that the shortcuts DO work, but only in that app. Is this what you find as well? – Ross Charette Feb 15 '11 at 18:21
show 6 more comments
feedback

(This was linked to as a duplicate, and it's one of my favorite topics anyway... :))

I like alfred too, but I'm not asking about launchers.

Does Apptivate count?

I personally use FastScripts and something like:

tell app "Terminal"
    reopen
    activate
end tell
# reopen is meant to make a new window or document if there's no open windows
# it doesn't bring the window to front however

Or:

set f to "HD:Library:Documentation:Acknowledgements.rtf"
tell app "TextEdit"
    activate
    if (count windows) = 0 then open file f
    try
        set bounds of window 1 to {460, 22, 1460, 1200}
    end try
end tell

@Daniel Beck:

You cannot usually create a keyboard shortcut using Esc for Services in System Preferences » Keyboard » Keyboard Shortcuts.

You can use ⌘⎋ though. And I know you said usually, but just can also be used by manually editing the property lists. Instructions specifically for using as a shortcut.

You can only assign keyboard shortcuts to applications' menu items and services. Terminal.app is neither.

There's also the methods in NSResponder... But it's mostly text editing actions, nothing related to opening applications.

link|improve this answer
I interpreted his answer as to not wanting third party software like launchers. So FastScripts, Apptivate etc. were out -- although they admittedly probably work better than my solution. I know about editing the plists, I explored this a while ago with @Arjan's help -- but I think you agree it's not usually possible, and quite easier to do using the named menu items shortcuts option. Btw, welcome to SU, I love your posts. – Daniel Beck Mar 1 '11 at 5:20
feedback

Your Answer

 
or
required, but never shown

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