Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Setup your mac to use Spotify as your alarm clock
# In order to use this script, you must replace 'YOURUSERNAMEHERE' with your Spotify username.
# Execute this script like so: 'osascript alarm_clock_spotify.scpt' (without single-quotes obviously)
# Full explanation here: http://www.nikhilgopal.com/2011/08/show-and-tell-applescript-spotify-alarm.html
# If you would like to specify a playlist, please refer to this gist: https://gist.github.com/3344118
set volume 2
open location "spotify:user:YOURUSERNAMEHERE:playlist:muzic"
tell application "Spotify"
set the sound volume to 0
play
repeat 10 times
if sound volume is less than 80 then
set sound volume to (sound volume + 10)
delay 3
end if
end repeat
end tell
@paulcgt

This comment has been minimized.

@matheus-santos

This comment has been minimized.

Copy link

commented Oct 24, 2017

Kudos man! Exactly what I was looking for.

@sam0per

This comment has been minimized.

Copy link

commented Nov 26, 2018

line 7 did not really work for me but I solved it doing the following:
In the Spotify app, right click on the playlist you want to listen to --> Share --> Copy Spotify URI
substitute the string between quotes after open location (line 7) with the copied Spotify URI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.