Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

An AppleScript to load an iPod Shuffle in a certain order iPod
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.]
  • Currently 1.80 / 5
  You rated: 1 / 5 (5 votes cast)

An AppleScript to load an iPod Shuffle in a certain order | 4 comments | Create New Account
Click here to return to the 'An AppleScript to load an iPod Shuffle in a certain order' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
An AppleScript to load an iPod Shuffle in a certain order
Authored by: riffraf on Jan 17, '07 10:11:10AM

Thanks. I've been wanting something like this for a while!

I made some adjustments so that I didn't have to keep going to get rid of grayed out podcasts.

I made a smart playlist "podcastsjr" with criteria being "Podcast is True" and "Played Count is 0." I use that for the source in the script, instead of "Podcasts"

Then, in the body of the script you do not need to have "played count is 0"


BUT - my podcasts don't start to update until after I click the OK button at the beginning.


[ Reply to This | # ]
An AppleScript to load an iPod Shuffle in a certain order
Authored by: kanny on Jan 17, '07 01:03:56PM

I use a simple scheme of ranking my audio stuff with most favourites 5*, spiritual music 4*, spiritual discourse 3*, regional music 2*, English songs 1* and podcasts 0*. Then i arrange the Shuffle content in reverse ranking from 5* - 0*. This puts things in that order.

[ Reply to This | # ]
An AppleScript to load an iPod Shuffle in a certain order
Authored by: Pyrrhus on Jan 18, '07 05:15:26PM
Use your Shuffle as a USB key instead, and all you have to do then is to sort out your folders in Shuffle with 01, 02, etc. How to do this? Just surf to

The bonus: you get to use your shuffle on multiple computers...

[ Reply to This | # ]
An AppleScript to load an iPod Shuffle in a certain order
Authored by: deeraeya2 on Jan 31, '07 05:31:24PM

The Shuffle can't play Apple Lossless or AIFF. This was causing strange stopping errors when copying from playlists with those files in them.

Adding this check when the files where being copied helped (sorry about the layout):

set theTracks to every file track in the playlist "For Shuffle"

--Check that each track kind is suitable for the Shuffle.
repeat with thisTrack in theTracks
if thisTrack's kind is not "Apple Lossless audio file" then
duplicate thisTrack to tempList
end if
end repeat

-- Actually move them
duplicate tracks of tempList to myShuffleList
end try

(I use a temp list so that the copying to the shuffle doesn't start before the copying to the list has finished (since checking the properties takes time).

An alternative would be to use a smart list as your music source and ensure that it doesn't include any Lossless or AIFF files.

For extra credit alter the script so that it converts those files to 128 AACs, leaving the original untouched :)

Actually it would just be cool if Apple allowed us to add Podcasts to the top of the autofill list, since that function already does the conversion to 128 AACs :(

[ Reply to This | # ]