Skip to content

Instantly share code, notes, and snippets.

@itsdamslife
Created August 16, 2012 10:58
Show Gist options
  • Save itsdamslife/3369279 to your computer and use it in GitHub Desktop.
Save itsdamslife/3369279 to your computer and use it in GitHub Desktop.
Add selected track into a playlist and start playing the playlist
tell application "iTunes"
duplicate selection to playlist "iTunes DJ"
if player state is playing then
if current playlist is not "iTunes DJ" then
play playlist "iTunes DJ"
else if current playlist is "iTunes DJ" then
if player state is playing then
print playing
else if player state is not playing then
play playlist "iTunes DJ"
end if
end if
else
play playlist "iTunes DJ"
end if
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment