CyBeRHQ
Formerly known as phoenix.uzaynet.nl.
iTunes Applescript
Posted on 21.03.2005 at 03:13:32 by CyBeR

So, to save me some typing I figured I'd get one of those annoying foo is now playing such-and-such MP3 things for my xchat. Downloaded one, and it didn't work. It was a TCL script that used a few shell-scripts, so I figured I'd have a look at those. They used applescript to get the data from iTunes, and just echoed that out. I used that at first, creating a single shell script to combine it into something directly usable for xchat.

Then I figured I might as well do it directly in applescript. Needed to figure out how that that works, since I haven't used Applescript in, like, 8 years. Fortunately, applescript is like english, so that went quickly too ;)

I've since recreated the thing in applescript, directly callable as osascript /path/to/script.scpt. It will then echo something along the lines of iTunes is currently spinning: The Mars Volta - L' Via L' Viaquez (from Frances The Mute) at 02:09. This can be used as a /exec -o in xchat, or aliased as such.

Find it here.

TrackBacks
Trackback URL: http://www.cyberhq.nl/news/archive/1111371212/trackback