Skip to content

Instantly share code, notes, and snippets.

Created April 27, 2015 13:44
Show Gist options
  • Star 15 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save anonymous/784de37358b27f5c7071 to your computer and use it in GitHub Desktop.
Save anonymous/784de37358b27f5c7071 to your computer and use it in GitHub Desktop.
IFTTT Spotify Alarm Clock
Spotify Alarm
Utilizing [IFTT recipe](https://ifttt.com/recipes/283707-spotify-alarm-clock)
In your mail client:
Create a rule in your mail client with the following properties
- Message content contains #wakeup
- Actions: Delete Message, Run AppleScript
Create an AppleScript with the following statements.
```
tell application "Spotify" to activate
tell application "Spotify" to playpause
```
Voila!
@stevepigg
Copy link

Thanks!

@BigTecAK
Copy link

BigTecAK commented Jan 4, 2017

I have Gmail, do you know how to setup the filter to do this? Thanks. Been looking for a way to do this.

@ultravicster
Copy link

You can't with gmail, you have to use the mail application is mac os.

@ultravicster
Copy link

Just to clarify,
-open up mail in mac os
-in the menu in the top of your screen hit "mail" and then "preferences"
-go to the "rules" tab
-make a new rule and put your applescript in the rule by clicking on "no scripts found" and then "open in finder" then just drag & drop your script in that folder that should be named "com.apple.mail" and you are done!

  • (the finished product should look like this btw)
    screen shot 2017-01-09 at 20 37 58

@AFisher1720
Copy link

Is it possible to set this up on iPhone using the mail app?

@diegov00
Copy link

diegov00 commented Oct 26, 2017

I am having a problem with the AppleScript. Spotify opens and the playpause action is being done by the script before the entire Spotify application loads therefore the song doesn't play. How do i get the Applescript to wait a couple seconds before toggling the play/pause button? [edit: nvm found the delay function and set it to 1 between the activate and play functions, fixed]

@justiceg
Copy link

how do i create the apple script part?

@oguzgultepe
Copy link

@justiceg use Script Editor and paste the following:

tell application "Spotify" to activate
delay 5
tell application "Spotify" to playpause

@michellekim55785578
Copy link

Hi all

Thanks a lot for the awesome app.
I want to set this up using iPhone. Do you know if I can setup using iPhone rather than Mac?

@marilonvd
Copy link

Hi all,

Same question as Michelle; but also, how do you set the time? You send an email to yourself containing #wakeup and add a time or..?

@stephieaixa
Copy link

Hello!! Any luck with this in iPhone?

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