« A bit of work ahead | Main | Two great Time Machine articles »

Shuffle iPod music from iTunes

An AppleScript to play my iPod music in shuffle from iTunes:

tell application "iTunes"

    activate

    -- Get the first iPod, I don't usually have more than one connected at the same time
    set myiPod to first item of (every source whose kind is iPod)
    -- Get the 'Music' playlist
    set myiPodMusic to playlist "Music" of myiPod

    -- View the playlist, turn on shuffle, minimize the window
    set view of front window to myiPodMusic
    set shuffle of myiPodMusic to true
    set minimized of front window to true

    -- Play some tunes
    play

end tell

I run it with FastScripts.

TrackBack

TrackBack URL for this entry: http://ithink.ch/blog/tb.cgi/186.

Make sure JavaScript is enabled before using this URL. If you would like to ping my blog but can't, please do send me an e-mail at os3476 at this domain.

Post a comment

Make sure JavaScript is enabled before posting a comment. If you would like to post a comment but can't, please do send me an e-mail at os3476 at this domain.

Do not meddle in the affairs of Coding Ninjas, for they are subtle and quick to anger.