Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Controlling Spotify with AppleScript

Essentially what I'd like to do is play an entire album via AppleScript. Right now, you can use their special URIs to load the album, but not play it. You can also play a specific track, but once that finishes playing, your queue resumes what was playing before.

Spotify's scripting dictionary is somewhat thin, does anyone know if there are plans to increase its depth a bit?

like image 650
Jesse Avatar asked Jan 17 '12 20:01

Jesse


2 Answers

If you want to play/pause whatever was most recently playing you can use the following scripts. If you save each of them as Automator applications and you can run them from Spotlight or Alfred.

Play:

tell application "Spotify"
    play
end tell

Pause:

tell application "Spotify"
    pause
end tell
like image 156
Matthew Avatar answered Oct 25 '22 02:10

Matthew


More recent versions of Spotify have added this to the dictionary. For example:

tell application "Spotify"
    play track "spotify:album:7ppypgQppMf3mkRbZxYIFM"
end tell
like image 30
Jesse Avatar answered Oct 25 '22 01:10

Jesse