OS X has an easy way to add keyboard shortcuts: in System Preferences.app go to the “Keyboard” preference pane, click on “Shortcuts” and then “App Shortcuts”. You can create a “global” keyboard shortcut (which will work in any application which has a matching menu item), or you can create an app specific shortcut which will only work in one particular application.
That’s great, but what happens if an application has two menu items with the same name? How can you tell which menu item will be used for the keyboard shortcut? Turns out there’s an easy way to do this, but one that I had never heard of, and I’m guessing others might not have known it either. I’m going to use 1Password as an example, but this will work in any OS X app.
I have been using 1Password’s “Vaults” feature and created two vaults: one called “Archive” for things I don’t use all that often, and another called “Mom” for passwords, etc. that I keep for my mom.
If I am in my primary 1Password vault and want to move something to one of the other vaults, here is the menu item if I want to move something to the “Archive” vault:
And here is the menu item if I want to move something to the “Mom” vault:
If I wanted to create a keyboard shortcut for 1Password in OS X’s System Preferences, this is what I would usually do:
But the problem with that is obvious: Does “Move” refer to Item » Share » Mom » Move or to Item » Share » Archive » Move?
Jamie Phelps linked to this tip on the awesome-but-sadly-now-defunct “Mac OS X Hints” site which explains that you can specify the exact menu item by using a
-> to indicate the exact menu item that you mean.
That means that given the two menus in my example, I would use “Item->Share->Archive->Move” and “Item->Share->Mom->Move” as shown here:
Now if I look at those two menu items again, I see that they each have the keyboard shortcut that I assigned to them:
⌘ + ⇧ + A for “Archive”:
⌘ + ⇧ + B for “Mom”:
Bonus Keyboard Shortcut Tips
Do you use the “Save as PDF…” feature in the standard OS X print menu? I bet many people don't even know it exists, but it’s a really handy feature, and it gets even better if you use the great “Save as PDF…” tip from David Sparks. He even made a screencast to show you how to do it.
Do you miss the “Save As…” menu item (which was replaced with the Really Not The Same Thing “Duplicate” menu item in Lion)? Did you know that (in most apps) you can still use “Save As…” if you press the ⌥ (option/alt) key when you go to the “File” menu? Even better, if you re-assign ⌘+⇧+S to “Save As…” you can have it appear without having to remember to hold down the ⌥ key. I wrote that up on TUAW a few years ago, and I recently made a one-minute How to Bring Back “Save As” in OS X screencast as well, showing how it is done. Just don’t compare the quality of my screen-cast to David’s. (Spoiler alert: his is much better!)