Skip to content

Instantly share code, notes, and snippets.

@yaotti
Created November 24, 2010 05:30
Show Gist options
  • Save yaotti/713166 to your computer and use it in GitHub Desktop.
Save yaotti/713166 to your computer and use it in GitHub Desktop.
tell application "iTunes"
set allSongs to (every file track of playlist "Library")
set idx to random number from 0 to (count of allSongs) - 1
set aSong to item idx of allSongs
play aSong
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment