My mac mini came with a remote control. When I press the play button, iTunes is launched. How can I change what happens when I press this button (e.g. launch a different program)?
-
It's probably related to a LaunchAgent. Maybe I can find which.– zneakCommented Aug 25, 2010 at 6:39
-
The MENU button of the remote is controlled by com.apple.RemoteUI, but I can't find the one controlling the Play button.– zneakCommented Aug 26, 2010 at 3:26
-
@zneak: would rebinding the menu button also wake up the computer from sleep mode like the play button does?– SensefulCommented Sep 1, 2010 at 21:14
-
I really don't know. :/– zneakCommented Sep 1, 2010 at 22:17
Add a comment
|
2 Answers
Some tool like Remote Buddy might help here, but it's probably much more than you asked for.
according to the writer : This seems to work with iTunes 8 and 9, although you'll need to redo the patch after upgrading.
Open a Terminal and type the following
cd /Applications/iTunes.app/Contents/MacOS
sudo mv iTunes iTunesX
sudo curl http://www.cs.umd.edu/~dmonner/iTunes -O
sudo chmod uog+x iTunes enter code here
From http://www.cs.umd.edu/~dmonner/iTunes
#!/usr/bin/env python
import sys, os, subprocess
launch = True
blocker = ""
apps = ["Spotify", "Songbird"]
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
-
4