September 12 2011 - 9:37 am

NEW: Play in Album Context

You can probably imagine that I hear a lot of unusual ideas for creating workflows for iTunes with AppleScript. Quite a while ago someone suggested a script that could be run when a track was playing that would find all the tracks of that track's album, put them in track order in a new playlist, and then play them in order starting from the original selected track. For example, "Time" from Dark Side of the Moon comes up and you want to hear "The Great Gig in the Sky", "Money", etc, in their album context.

But really. How many people ever want to do that? Well it turns out that the more I thought about how quirky a suggestion it was the more often I began noticing opportunities where I'd like to do the very thing. So I caved and wrote Play In Album Context.

If you select a track and then launch the script a new playlist will be created from the tracks of that track's album (actually, tracks that have the same Artist, Album, and Disc Number tags—whether that results in gathering the correct tracks for the album depends on how well you've tagged your tracks) and the selected track will begin playing from its album position in the playlist.

If a track is playing and the script is launched, the album playlist is created as described above, and the current track will continue playing from its album position in the new playlist. The trick of the script is to temporarily set the playing track's bookmarkable property, pause iTunes, and then immediately play the same track in the playlist; the track picks up playing from the bookmark set when the track was paused. There is a slight stutter when this transfer occurs, but if the goal is to hear the succeeding tracks in album context, it's probably a small inconvenience to bear.

Site contents © 2001 - 2020 (that's right: 2001) Doug Adams and weblished by Doug Adams. Contact support AT dougscripts DOT com. About.
All rights reserved. Privacy.
AppleScript, iTunes, iPod, iPad, and iPhone are registered trademarks of Apple Inc. This site has no direct affiliation with Apple, Inc.
The one who says "it cannot be done" should not interrupt the one doing it.