How To Stop iTunes From Interfering With The Mac Media Keys

NoteBook Apple MacBook   How To Stop iTunes From Interfering With The Mac Media KeysModern Mac keyboards are outfitted with a number of extra function keys. Using those, you can instantly adjust your volume, screen brightness, or command media playback.

There’s only one problem. Although they are essentially compatible with all applications, as a ‘feature’, these media keys automatically launch and start playing songs from iTunes. Even when you’re using them in another application.

And there’s absolutely no easy way to turn it off. Most call it a bug, but Apple calls it a feature, and they don’t seem to be planning to release a fix for this iTunes problem anytime soon. Over the past few years, people have come up with all sorts of tricks to be able to use these keys properly. We’ll be discussing a number of them below – ranging from quick fixes to total workarounds.

Solution One: Delete iTunes

WHAT? We told you we’d be seeing some pretty easy work-arounds. Well, this is about as quick as it gets. If you delete iTunes, you won’t be bothered by it launching in the future. Of course, this solution is only applicable for people who don’t use iTunes at all. If you ever want to reinstall iTunes, you can download iTunes from the Apple website for free.

deleteitunes   How To Stop iTunes From Interfering With The Mac Media Keys

HOW? Go to your applications folder by opening Finder and selecting Go -> Applications. Find the iTunes application and drag it to the trash can. Finally, select Finder -> Empty Trash… This will completely erase iTunes from your computer.

+ Quick and easy
+ Complete solution – no further hassle
- You can’t use iTunes at all

Solution Two: Keep iTunes Or QuickTime Idle In The Background

WHAT? There are two other situations where iTunes doesn’t steal your focus. In the first scenario, iTunes is already open. In the second, QuickTime Player is. Basically, this solution will allow you to use the media function keys without interruption, but can be CPU intensive. For that reason, the QuickTime technique is preferred.

HOW? Open QuickTime, but no video. The application will run in the background and prevent iTunes from picking up the media key signals.

Alternatively, you can also use iTunes, but be sure to open the iTunes store before hiding or minimizing the application. That way, no songs will start playing spontaneously.

+ Quick and Easy
- CPU intensive
- Needs to be done continuously, and again after each startup

Solution Three: Disallow iTunes To Start By Media Keys

WHAT? There are basically two things we’re going to do. First, we’ll rename an essential file in the iTunes application package. That way, iTunes can’t start – not even when the media function keys try to. Second, we’re making an alternative executable that will launch the altered iTunes file.

HOW? Time to get our hands dirty. Open the Terminal application from Applications -> Utilities -> Terminal. Type the code below, or use copy-paste. Press enter after each line. You’ll be asked for your computer password after the second command.

cd /Applications/iTunes.app/Contents/MacOS
sudo mv iTunes iTunesX
sudo chmod uog+x iTunes

Close the terminal and open AppleScript Editor, also via Applications -> Utilities. Copy-paste the code below.

tell application “Finder”
open document file “iTunesX” of folder “MacOS” of folder “Contents” of application file “iTunes.app” of folder “Applications” of startup disk
end tell

Select File -> Save As… and change the File Format to Application. Call it iTunesX and save it to your applications folder.

Screen shot 2010 05 03 at 21.08.20   How To Stop iTunes From Interfering With The Mac Media Keys

This executable will still be able to launch iTunes for you, and best of all, you can drag it to your dock. Alas, launching iTunes this way will also open a terminal window for the duration of the session.

+ Complete solution – no further hassle
- Relatively complicated
- Starts terminal window with iTunes

Do you have any other suggestions on how to deal with this problem? Let us know in the comments section below!

The comments were closed because the article is more than 180 days old.

If you have any questions related to what's mentioned in the article or need help with any computer issue, ask it on MakeUseOf Answers—We and our community will be more than happy to help.

18 Comments -

0 votes

Ciaran

I modified the applescript so that a terminal window doesn’t open – it works by renaming the “iTunesX” file, opening it, then renaming it back to “iTunesX”.

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

When you run this script for the first time, it will rename the iTunes file to iTunesX, meaning that you do not have to go typing commands into terminal in the first place.

So no getting your hands dirty!

I think that also gets rid of the two negative points on the last method completely.

0 votes

Ciaran

I modified the applescript so that a terminal window doesn’t open – it works by renaming the “iTunesX” file, opening it, then renaming it back to “iTunesX”.

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

When you run this script for the first time, it will rename the iTunes file to iTunesX, meaning that you do not have to go typing commands into terminal in the first place.

So no getting your hands dirty!

I think that also gets rid of the two negative points on the last method completely.

0 votes

Simon Slangen

I’ve also written an OS X application that’ll solve this problem in a way similar to solution #3, but is a lot easier and cleaner to use. Here‘s a picture tutorial of how to use it.

12 MB
Download from RapidShare
Download from DropBox (mirror)

Completely free and virus-free. I wouldn’t call myself a good programmer, though. If you want to improve upon this software solution, contact me via simon [at] makeuseof (dot) com or leave a comment below, and I’ll send you what I already have. Cheers.

0 votes

Jeff

Thank you so much. This application is amazing, no tinkering required! Works like a charm.

0 votes

Simon Slangen

I’ve also written an OS X application that’ll solve this problem in a way similar to solution #3, but is a lot easier and cleaner to use. Here‘s a picture tutorial of how to use it.

12 MB
Download from RapidShare
Download from DropBox (mirror)

Completely free and virus-free. I wouldn’t call myself a good programmer, though. If you want to improve upon this software solution, contact me via simon [at] makeuseof (dot) com or leave a comment below, and I’ll send you what I already have. Cheers.

0 votes

Kyle

When I typed in the third terminal command, I kept getting a file not found error. I changed it to sudo chmod uog+x iTunesX instead of sudo chmod uog+x iTunes and it worked like a charm. If anyone sees any problem with this, let me know, otherwise it should work for anyone getting the same error. I’m very curious as to why MakeUseOf’s method didn’t work for me (assuming they tested this out themselves).

0 votes

Simon Slangen

There seem to be a few people having trouble with that line, but it works for most people. If you also want to rid yourself of that command screen pop-up, try Ciaran’s applescript, or the OS X application I posted above. Cheers.

0 votes

Anonymous

There is a much easier way than hacking iTunes.

1. Go into Keyboard preferences, turn off the media keys (reenable function keys).
2. Download Spark or Quiksilver.
3. Configure function keys to desired functionality.

0 votes

Simon Slangen

Yes, except that you’d also have to start messing with the keyboard lighting, screen brightness, volume, etc. and that the media keys wouldn’t work in a lot of other applications either. But if you only want to use them with, say, Spotify, it would indeed work flawlessly.

0 votes

Michael

There is a much easier way than hacking iTunes.

1. Go into Keyboard preferences, turn off the media keys (reenable function keys).
2. Download Spark or Quiksilver.
3. Configure function keys to desired functionality.

0 votes

Tom

I tried this but it’s not working. How do I undo it?

0 votes

Simon Slangen

Try “sudo chmod uog+x iTunesX” instead of “sudo chmod uog+x iTunes”. That’ll probably solve it.

If you want to undo it, simply type this in the Terminal:

cd /Applications/iTunes.app/Contents/MacOS
sudo mv iTunesX iTunes

0 votes

Simon Slangen

Try “sudo chmod uog+x iTunesX” instead of “sudo chmod uog+x iTunes”. That’ll probably solve it.

If you want to undo it, simply type this in the Terminal:

cd /Applications/iTunes.app/Contents/MacOS
sudo mv iTunesX iTunes

0 votes

cnn

i tried the terminal line and also the new script.. but when i launch itunesx, it says application wont launch

0 votes

Simon Slangen

Have you tried the application (mirror) I posted above? I’ve incorporated some improvements, and made it fairly easy to use.

0 votes

Daniel Richardson

A much simpler way is to use some modifier keys when pressing the media buttons.
For instance if you have Spotify open and press pause on your keyboard, iTunes will start up/start playing.
However if you have ‘Shift + alt’ down when pressing play/pause, you won’t get anything happening with iTunes.
This is tested on Snow Leopard

0 votes

Ole

thanx Daniel!

0 votes

Daniel Richardson

A much simpler way is to use some modifier keys when pressing the media buttons.
For instance if you have Spotify open and press pause on your keyboard, iTunes will start up/start playing.
However if you have ‘Shift + alt’ down when pressing play/pause, you won’t get anything happening with iTunes.
This is tested on Snow Leopard