Shell Script to Control iTunes
Sunday, May 25th, 2008For mother’s day, one of my wonderful wife’s requests was to have a bit of a Ms. PacMan marathon.
So, out came the ghetto arcade controller and, a bit longer than expected later, a Ms. PacMan marathon she had! (A bit longer because a nasty latency bug has cropped up in MAME OS X somewhere along the way. I found a workaround. But, yuck.)
Now, MAME is full screen and pausing the game just to deal with iTunes shuffle play song selection suckage (since iTunes on the MAME machine sends tunage to the garage workspace) is not considered good gaming etiquette.
Clearly, I need a shell script to control iTunes. Remote Buddy is cool, but it is too slow, requires too much configuration, and, after much use, has proven a bit flaky. A simple, straightforward, shell script is sufficient and, certainly, I cannot have been the first too think of this.
I wasn’t! I found this ancient hint on MacOSXHints.com.
David Schlosnagle — who seems to have disappeared — wrote a very useful little shell script that can play, pause, go to the next track, and set the output volume. The script, as posted, doesn’t quite work all the time due to (I presume) shell changes between 10.0(?) and Leopard.
So, I grabbed a copy of the script, dropped it in my hacques repository, and have updated it for Leopard. I also added the ability to set ratings from the command line (and the status command will show the currently playing track’s rating). Minor changes, really.
The latest version can always be had at http://svn.red-bean.com/bbum/trunk/hacques/itunes.sh.
Thanks to David for doing this in the first place!!


