One of the things I love about OS X is the consistency in the interface. Consider File -> Open (Command-O), Edit -> Copy (Command-C), and File -> Print (Command-P). It doesn’t matter what application you’re running, you know exactly what those menu command and shortcut keys will do. Consider Command-F. Everyone knows what that does—activates Find or Search. At least, it does in Safari, TextEdit, iPhoto, and probably 200 other programs I could name.
Try it in iTunes, though, as I used to do by force of habit, and you get…the full screen iTunes interface! Quite the shock when you’re expecting to see the cursor jump to the Search box. With so many other programs relying on Command-F, it’s hard to overcome that much muscle memory, so I would often find myself looking at a huge Cover Flow browser when I was expecting to search for an album.
Big deal, you may be thinking—just use the handy Keyboard Shortcuts tab of the Keyboard Shortcuts System Preferences panel to reassign Command-F to Search in iTunes. Great idea, with but one big issue: there’s no menu entry for Search in iTunes. (There is one for Store -> Search, but that won’t search your local library.) So how do you go about this? Terminal to the rescue…
The first step actually doesn’t involve Terminal—we’re going to change the View -> Full Screen shortcut from Command-F to something else. Quit iTunes and open the Keyboard & Mouse System Preferences panel. On the Keyboard Shortcuts tab, click the plus sign at the bottom left to add a new shortcut. In the new window that opens, set the Application pop-up to iTunes, enter Full Screen (as shown, with capitalization) as the Menu Title, and then type a key combination in the Keyboard Shortcut box—Shift-Command-F, perhaps? Click Add and you’re done—you’ll now be using Shift-Option-F (or whatever keys you chose) to access iTunes’ Full Screen mode.
Now launch Terminal (make sure iTunes isn’t running) and enter this command. (Note that I’ve broken one long line onto two rows here for a narrower display; you should be able to copy and paste it as is, thanks to the backslash.)
defaults write com.apple.iTunes
NSUserKeyEquivalents -dict-add "Target Search Field" "@F"
Press Return, and if you typed it correctly, you should see nothing more than a Terminal prompt. That’s it; you’re done—you’ve just assigned Command-F to move the cursor to the iTunes search box. Test it out by opening iTunes and pressing Command-F, and you should see the cursor jump to the Search box.
In case you’re curious about the syntax,
is the Option key,
is the Shift key, and
is the Control key. You can combine these to make more-complex shortcuts:
would mean Shift-Control-F, for example.
If you ever decide you want the old behavior back, you don’t need to involve Terminal at all. Just go back to the Keyboard Shortcuts tab of the Keyboard & Mouse System Preferences panel, and delete (using the minus sign) the entry for iTunes’ Full Screen menu (remember to quit iTunes first). Once deleted, the next time you launch iTunes, Command-F will be back to its old behavior.
But personally, I don’t intend to ever reverse this setting, as iTunes’ Command-F behavior (finally) matches the majority of the other applications on my machine.