Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

While scripts like This Is The Last Song and Just Play This One work great with local songs, they don't seem to work with Internet radio stations like Groove Salad in spite of the fact that the name and artist of the currently playing song are displayed in iTunes.

Anyone know how I can get this functionality?

share|improve this question
up vote 1 down vote accepted

I figured this out some time ago, (I suppose I managed to google up the code or something).

tell application "iTunes"
        if (get current stream title) is not missing value then
            set lastSong to current stream title
        end if
    end try
end tell

tell application "iTunes"
    repeat until current stream title is not equal to lastSong
        delay 1
    end repeat
    tell me to quit
end tell

I'm a novice to programming, so if there is a better way to code, please let me know.

EDIT: My code is probably based on Doug Adams' This is The Last Song and Just Play This One scripts. If/when I find the time I'll see if I can combine our code together to make scripts that work on everything.

share|improve this answer

I don't think this is currently possible with the way iTunes works. I'm going to speculate that the song title and artist are being streamed to you from the internet radio station that you are listening to rather than being updated once a new song comes along. You might notice this with certain radio stations because the audio will lag behind the updated song information because of buffering.

Another point to bring up is that since you're listening to an internet radio station, the audio is being streamed rather than loaded/unloaded. There aren't any breaks in the audio stream between songs. iTunes doesn't have any way to know when a song starts or stops because the song information being displayed doesn't necessarily have to correlate to the audio file that is being played over the stream (for example, some stations only put up their station name with no song information..)

Hope this clarifies the situation a bit.

share|improve this answer
Thankf for your insight liltechdude, but it turns I that I was able to pull this off. See my answer for details. – Orion751 Feb 3 '11 at 5:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .