# 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' |
tellapplication'Spotify' |
setthesound volume to0 |
play |
repeat10times |
ifsound volume is less than80then |
setsound volume to (sound volume +10) |
delay3 |
end if |
end repeat |
end tell |
The URL to the full explanation is now: http://nikhilgopal.com/applescript/utility/2011/08/03/show-and-tell-applescript-a-spotify-alarm-clock-on-mac.html |
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 |