The goal
To launch the OS X radio app Radium automatically, including the ability to select AirPlay speakers as necessary.
The problem
Selecting AirPlay speakers is a relatively new ability for iTunes. I wanted to replicate it in my favourite (and one of the only) OS X internet radio apps.
The Applescript
Extras
This can be combined with this phenomenal hint to allow you to control Radium using the superb iOS Remote.app. This is especially awesome if you already use Remote.app to control your regular iTunes music, and your favourite radio stations aren’t on iTunes. In my case I did all this specifically to be able to AirPlay TalkSport using the Remote.app. It works incredibly well. The stay-open ‘listener’ app’s response is almost instantaneous when you start playing an item from the ‘Scripts’ playlist.
NB: Since iTunes 11.x the song comment field is limited to 256 characters. You can work around this by using a shorter-than-256-characters script to ‘open’ your main script. My opener script looks like this:
I can also use the script with iCal’s ‘open file’ command to schedule TalkSport to turn on at 1pm on Wednesdays and Fridays (1pm is when Hawksbee & Jacobs are on, and I work from home those two days).