With the introduction of Mac OS X 10.6 (Snow Leopard) many cool features were introduced and at least one not so cool feature: whenever you press the Play/Pause button your keyboard when you have e.g. Spotify running, it opens up iTunes. Anyway, nothing we cannot solve with a little hacking, right?
First start by downloading this script and save it somewhere on your computer. (DISCLAIMER: This script was taking from this thread on Apple Discussions). The contents of the script are listed below. When the script is launched it checks if another program that uses the multimedia keys is running. If there is it ignores the request to start iTunes, otherwise it simply proceeds with starting iTunes. You can change the apps setting to list more apps that you want to prevent iTunes from launching.
#!/usr/bin/env python import sys, os, subprocess launch = True blocker = "" apps = ["Ecoute", "Spotify", "Songbird", "Mplayer OSX Extended", "Mplayer"] ps = subprocess.Popen("/bin/ps -x", shell=True, stdout=subprocess.PIPE) for line in ps.stdout.read().split("\n"): for app in apps: if app in line: launch = False blocker = app ps.stdout.close() if launch : os.spawnvp(os.P_WAIT, '/Applications/iTunes.app/Contents/MacOS/iTunesX', sys.argv) else : print "Not launching iTunes while %s is running." % blocker
Next issue the following commands in a Terminal (of course replace <downloaded-script-location> with the directory where you downloaded the script to (e.g. /Users/myname/Downloads).
cd /Application/iTunes.app/Contents/MacOS sudo mv iTunes iTunesX sudo mv <downloaded-script-location>/iTunes.py iTunes sudo chown root:admin iTunes sudo chmod 0755 iTunes
Et voila, this should fix it. You can check by opening up Console to check the logs for the message “Not launching iTunes while is running”.
Comments, tips and suggestions welcome!








