This has been bugging me for a couple years now. So in Mac OS X you can assign your own Keyboard Shortcuts (in System Preferences > Keyboard > Keyboard Shortcuts) by typing in the exact name of the menu item to which you intend to bind the keystrokes. So what are you supposed to type if:

  • the menu is nested? or
  • there are two menu items with the same name that do different things?

I don't care about special cases like Firefox. Please don't mention special cases, unless this is a special case where Apple failed it.


  • Example with Terminal: Shell > New Tab > Pro and Shell > New Window > Pro. I was using this as an example. I can't imagine that Terminal is the only app with this design flaw.

  • Another example from Pages: File > Duplicate and Edit > Duplicate. If you want to make Command-D duplicate, it'll set it for the edit menu but when that document gets locked, only the file menu has the option for duplicate, the edit menu is greyed out and the shortcut is locked to the unaccessible one.

link|improve this question
a) Nested menus usually work fine. – Vervious Aug 18 '10 at 23:03
1  
If you don't want to re-define ⌘N, I haven't found a solution. This question was asked before: superuser.com/questions/118364/… – mankoff Aug 19 '10 at 2:12
@Nano8Blazex nested works, but what about non-unique nested? – mankoff Aug 19 '10 at 2:13
@mankoff that's the question! I commented before I realized that. And it is sort of a duplicate. – Vervious Aug 19 '10 at 3:51
show 1 more comment
feedback

2 Answers

up vote 3 down vote accepted

There are two answers here, depending on exactly what your question is:

  • If what you want to do is just what your example states, try this:

    • Launch Terminal, and open its preferences ⌘,.
    • In the Settings preference pane, select Pro in the left-hand column.
    • At the very end of the left-hand column, click the Default button.

    At that point, you'll find that ⌘N now opens a new window in your preferred style, and ⌘T does the same for a new tab.

  • If your example was just an example, and it's some other app where you want to add a keyboard shortcut, you should be able to do it via System Preferences → Keyboard → Keyboard Shortcuts → Application Shortcuts → +.

    As @Nano8Blazex said, you can usually just enter the name of a nested shortcut and it will work fine.

link|improve this answer
So, is it that non-unique menu items can't be reliably assigned a shortcut? – Jim Aug 19 '10 at 5:07
It depends—and of course, well-behaved Mac-like apps don't have duplicate submenu items. When I tried it with MS Entourage, though, it applied the keyboard shortcut to both menu items. Clicking the shortcut caused the right-most, bottom-most of the menu items to be triggered (which may or may not be what you want, of course). Creating a similar keyboard shortcut for Terminal, though, did nothing at all. – Dori Aug 19 '10 at 5:51
feedback

On Lion you can specify the menu names like >Format>Indentation>Increase:

You could also assign a shortcut to an AppleScript like:

tell app "System Events" to tell process "Terminal"
    click menu bar 1's menu "Shell"'s menu item 1's menu "New Window"'s menu item "Pro"
end tell
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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