Skip to content

Instantly share code, notes, and snippets.

@mattetti
Created September 2, 2015 06:00
Show Gist options
  • Select an option

  • Save mattetti/9aa9e7844c043c35f6a2 to your computer and use it in GitHub Desktop.

Select an option

Save mattetti/9aa9e7844c043c35f6a2 to your computer and use it in GitHub Desktop.
JXA (JS) automation script to play the "morning" playlist, only works on recent versions of OS X
app = Application('iTunes')
app.activate()
app.stop()
playlist = app.sources["Library"].userPlaylists["morning"]
try {
playlist.play()
}
catch(err) {
console.log("The playlist probably doesn't exist", err)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment