Modern Mac keyboards have built-in media keys which can be quite handy—unless you want to use them with something other than iTunes. If you fall into that camp, here's how to disassociate those keys with iTunes once and for all.

We've shown you a few ways to stop iTunes from hijacking your Mac's media keys, but…
Read more Read more

The problem is that, while some other media players have support for the media keys, OS X always links them with iTunes, causing iTunes to launch when you hit the play/pause button. There are a number of ways to fix this. You can delete iTunes completely, including any copies on your backup disk, which is fine if you don't use it, and if you change your mind, it's easily re-installed from Apple's web site. If you need to keep iTunes as a safety net, this won't work though. Another option is keeping iTunes pointed at the Music Store, or keep an empty Quicktime open in the background, but this is annoying and can be heavy on system resources. Thus, if you're comfortable with it, the best method is to actually dig into the system files themselves.

Advertisement

You'll need to use Terminal and Applescript Editor to pull this off, but it shouldn't be too difficult. Open up a terminal window and type (or better yet, copy and paste) these three lines of code separately, hitting enter after each line and entering your password when prompted. The Terminal won't show you your password as you type, but it is accepting the keystrokes.

cd /Applications/iTunes.app/Contents/MacOS

sudo mv iTunes iTunesX

sudo chmod uog+x iTunesX

This renames a file within the iTunes app so it can't launch. Of course, if you're using this method, it means you still want to keep iTunes handy (perhaps your media player of choice draws from your iTunes Library), so you'll have to make a quick script that will launch iTunes. Open up Applescript Editor and just copy and paste this code:

tell application "Finder"
try
set name of document file "iTunesX" of folder "MacOS" of folder "Contents" of application file "iTunes.app" of folder "Applications" of startup disk to "iTunes"
end try
tell application "iTunes" to activate
set name of document file "iTunes" of folder "MacOS" of folder "Contents" of application file "iTunes.app" of folder "Applications" of startup disk to "iTunesX"
end tell

Go to File and Save the script in your Applications folder (or wherever you want). Make sure the file format is "Application" so it is easily launch-able, too. Then, when you want to open iTunes, just launch this tweaked application instead—iTunes will open right up.

Note that the original instructions at MakeUseOf used a different version of the 3rd Terminal command: sudo chmod uog+x iTunes instead of using iTunesX at the end. When I tested it, this line kept giving me an error saying that it couldn't find the system file "iTunes", which makes sense, because we had just renamed it to iTunesX. With my small change it worked like a charm for me; in fact, I tested the media keys with Songbird 1.4, using the Apple Media Key Support add-on. Note that the iTunes will do a quick bounce in the dock whenever you press play/pause (or, if iTunes isn't in your dock, you'll see your dock shift a little bit), though it didn't open or interfere with the keys' functionality. If you've got your own preferred method of working around this Snow Leopard "feature", let us know in the comments!

Update: While many people caught on and fixed it themselves, I made a mistake and forgot to make the aforementioned change in the actual instructions at the beginning of the post. If the fix didn't work for you, try it again using the updated code and it should work!