Skip to content

Instantly share code, notes, and snippets.

@ngopal
Created August 13, 2012 21:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ngopal/3344118 to your computer and use it in GitHub Desktop.
Save ngopal/3344118 to your computer and use it in GitHub Desktop.
Setup your mac to use Spotify as your alarm clock--but also specify a playlist
# In order to use this script, you must replace 'YOURUSERNAMEHERE' with your Spotify username.
# Execute this script like so: 'osascript start_spotify_with_playlist.scpt' (without single-quotes)
# Full explanation here: http://www.nikhilgopal.com/2011/08/show-and-tell-applescript-spotify-alarm.htm
delay 2
open location "spotify:user:YOURUSERNAMEHERE:playlist:muzic"
tell application "Spotify"
play
end tell
@cnajarian
Copy link

Hey, I am having trouble executing this. When I run it, it simply opens up spotify and plays whatever song has been paused. My playlist is called "alarm" and I am substituting that with "muzic"

@educampos96
Copy link

Use the playlist ID instead of the name. On the playlist next to the "Play" button, click on the More button "..." > Share > Copy Spotify URI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment