2008/06/25

Applescript for iTunes: ‘Next Album’

Here’s an Applescript I like to use. I listen to iTunes with ‘Album Shuffle’ activated, so I don’t have to think about what to listen to next. (And, embarrassingly, to keep the music going after an album finishes; if I’m thinking about something when the music stops, I’ll totally forget that I had music going in the first place and sit in silence for hours.)

The problem is that sometimes you don’t want to listen to a particular album. And there’s little worse than hitting ‘Next Song’ a dozen times to skip to the next one. Luckily, iTunes is rather scriptable:

tell application "iTunes"
    pause
    set |current album| to the album of the current track
    repeat while the album of the current track is equal to |current album|
        next track
    end repeat
    play
end tell