An AppleScript to load an iPod Shuffle in a certain order

Jan 17, '07 07:30:01AM

Contributed by: tinker

Like a lot of people, I tend to want different things on my iPod Shuffle. In my case, I want (a) current news podcasts, for my morning commute; (b) a random selection of fast music, for my cardio workout at the gym; (c) some "talk" podcasts, for the rest of my workout; and (d) productivity and tech podcasts, for the commute home. Initially, I set up a series of smart playlists to get my Shuffle contents set up automatically, but that got cumbersome, and it never really succeeded in getting them in the order that I wanted.

So, after fiddling with Automator and discovering the appalling lack of a "remove songs from playlist" option, I wrote an AppleScript to handle the task.

In order to use it, you really only need to do two things. First, make sure that you don't have any greyed-out podcast episodes -- the ones with the Get button -- sitting in your podcast directory. For some reason, they are included when the script tries to upload podcasts to the Shuffle, and they produce a file permission error. (I haven't figured out a way to fix this, and the AppleScript item attributes don't seem to have been written with this problem in mind.) Second, set up a separate playlist with workout music in it, called Workout Music.

Once you have done these two things, the script sets up a playlist called shuffle in the order that you've defined it in the AppleScript. In this case, it puts recent news podcasts first, followed by a random selection of 10 songs from my workout music playlist, followed by talk, productivity, and tech podcasts. All you need to do is plug in the Shuffle and autofill it from the shuffle playlist.

[robg adds: You'll probably want to customize the script a bit to reflect your news and podcast preferences. I haven't tested this one, as my Shuffle has gone into hiding, apparently fearful of being replaced with a second generation unit.]

Comments (4)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20070113140023949