Help - Desktop (Linux, Windows, Web Player)

Reply
Gig Goer
Posts: 3
Registered: ‎28-04-2012
Accepted Solution

How to use Spotify as an alarm clock

I use Winamp as my alarm clock, a custom script runs as a scheduled task that randomly chooses from a list of playlist files, some point to local music and some point to internet radio stations.

 

Is it possible to get Spotify to automatically play music so I can add that to my script?  I tried using the "spotify:user:username:playlist:..." and "http" links but the playlist just loads, the music doesn't start playing automatically.

 

Any ideas?  Thanks!


Solution!
Chosen by oldschoolsquare (Garage Band)
Music Lover
Posts: 1
Registered: ‎11-02-2014

Re: How to use Spotify as an alarm clock

Create a .bat file on your computer, like spotify.bat. Enter the following lines:

START C:\Users\Peter\AppData\Roaming\Spotify\spotify.exe
ping 1.1.1.1 -n 1 -w 10000 > nul
START C:\Users\Peter\AppData\Roaming\Spotify\spotify.exe spotify:track:76DiZTSFs57PhznesB6RIu

 

Edit the path to your spotify installation.

 

For me, running spotify with a track immediately does not always start the music, which could have dire concequences. For that reason, I first run spotify , allowing it to initiate for 10 seconds, then I start the track.

 

Hope this helps someone.

View solution in original post

Solution!
Chosen by oldschoolsquare (Garage Band)
Music Lover
Posts: 1
Registered: ‎11-03-2015

Re: How to use Spotify as an alarm clock

I use this applescript as an alarm clock, it starts the playlist an slowly increase the volume.

 

You just need to change the playlist link (jx_mercurio:playlist/1Pkkyam0tpCv6Bp6QLsDXD) for yours. You can obtein it by a right click on the playlist, and then copy the playlist link.

 

I hope this would help you.

 

---------------------------------------------------------------------------------------------

 

on run {input, parameters}

 

set volume 3

 

open location "spotify:user:jx_mercurio:playlist:1Pkkyam0tpCv6Bp6QLsDXD"

delay 5

tell application "Spotify"

set the sound volume to 20

play track "spotify:user:jx_mercurio:playlist:1Pkkyam0tpCv6Bp6QLsDXD"

repeat 10 times

if sound volume is less than 80 then

set sound volume to (sound volume + 10)

delay 30

end if

end repeat

end tell

 

end run

View solution in original post


All Replies
Music Fan
Posts: 1
Registered: ‎26-11-2012

Re: How to use Spotify as an alarm clock

Hey

I'm not sure if you found a fix for this but this is what i've been doing:


Copy the URI link for a song in the playlist you wish to have as your alarm

open up a web browser (IE, Firefox etc.)
go into options and set the URI as the home page - this way every time you open the browser it will play this song, in that playlist
Go to control panel > Administrative tools > task scheduler
Create a new task to open your web browser at the time you want to wake up

Presto!

 

I did find however that spotify may need to stay open as sometimes it craps out and says "TRACK NOT FOUND".

 

Good luck!  And let me know how you get on!

Elephant Jamboree

Music Fan
Posts: 1
Registered: ‎05-02-2013

Re: How to use Spotify as an alarm clock

Create a task scheduler basic task to launch IE with the argument variable set as the HTTP link for the playlist which you wish to wake to. 

Seems to work when I start the task manually on Win8, we'll see if I wake to it at 7:30.

 

Solution!
Chosen by oldschoolsquare (Garage Band)
Music Lover
Posts: 1
Registered: ‎11-02-2014

Re: How to use Spotify as an alarm clock

Create a .bat file on your computer, like spotify.bat. Enter the following lines:

START C:\Users\Peter\AppData\Roaming\Spotify\spotify.exe
ping 1.1.1.1 -n 1 -w 10000 > nul
START C:\Users\Peter\AppData\Roaming\Spotify\spotify.exe spotify:track:76DiZTSFs57PhznesB6RIu

 

Edit the path to your spotify installation.

 

For me, running spotify with a track immediately does not always start the music, which could have dire concequences. For that reason, I first run spotify , allowing it to initiate for 10 seconds, then I start the track.

 

Hope this helps someone.

Music Fan
Posts: 1
Registered: ‎22-04-2014

Re: How to use Spotify as an alarm clock

Man, your a boss!

Please, tell me some more commands.. For example how do I pause / play? Next track?

Festival VIP
Posts: 11
Registered: ‎24-05-2013

Re: How to use Spotify as an alarm clock

This is super cool, I have to force myself to get up every day so I will try this. also I love writing computer code so coding+awesome music? I'm happy I found this.

"I will slay you, Vandheer Lorde!"

What's a Spotify Rock Star, and how do I become one?
Music Fan
Posts: 1
Registered: ‎07-01-2015

Re: How to use Spotify as an alarm clock

Is there any way to do this with a playlist? I can get spotify to open the playlist but it doesn't autoplay using the playlist URI

Solution!
Chosen by oldschoolsquare (Garage Band)
Music Lover
Posts: 1
Registered: ‎11-03-2015

Re: How to use Spotify as an alarm clock

I use this applescript as an alarm clock, it starts the playlist an slowly increase the volume.

 

You just need to change the playlist link (jx_mercurio:playlist/1Pkkyam0tpCv6Bp6QLsDXD) for yours. You can obtein it by a right click on the playlist, and then copy the playlist link.

 

I hope this would help you.

 

---------------------------------------------------------------------------------------------

 

on run {input, parameters}

 

set volume 3

 

open location "spotify:user:jx_mercurio:playlist:1Pkkyam0tpCv6Bp6QLsDXD"

delay 5

tell application "Spotify"

set the sound volume to 20

play track "spotify:user:jx_mercurio:playlist:1Pkkyam0tpCv6Bp6QLsDXD"

repeat 10 times

if sound volume is less than 80 then

set sound volume to (sound volume + 10)

delay 30

end if

end repeat

end tell

 

end run

Music Lover
Posts: 2
Registered: ‎26-07-2015

Re: How to use Spotify as an alarm clock

The easiest way is to have a vbs file that does this

 

I have one that plays music atomatically(paste this into notepad):

 

Set WshShell = WScript.CreateObject("WScript.Shell")
Comandline = "C:\Users\Max\AppData\Roaming\Spotify\Spotify.exe"
WScript.sleep 500
CreateObject("WScript.Shell").Run("spotify:user:8aller:playlist:4aoBDuMJnk4Oza13a8Fnbo")
WScript.sleep 3000
WshShell.SendKeys " "

 

Change the path to your spotify app location on your pc.

change the my url to the "Spotify Url" of your playlist.

 

click file>save as then save as something.vbs and save as all files

 

click on the vbs script - it should open and play your playlist

if you go to bed at the same time every day you can use task scheduler for it to autoplay at the same time every day

 

it is also possible to have the music fade(for sleeping) via vbs and get gradually louder as well(think an alarm).

Announcements


More

Please bear in mind that the Community is not an official Spotify support service. It's a place where we all help each other, whether we work for Spotify or not. So please use your discretion when using the forum.