PDA

View Full Version : AppleScript and Spotify




ppcg4mac
Mar 31, 2012, 08:29 PM
I have been trying to make some applets that control Spotifys music playback, i have don this with itunes before. When i make the play/pause one it says that playpause is not recognized, yet it is in the Apps dictionary. Can someone help me on this.

what im typing is this.

tell application "Spotify"
playpause
end tell


why is this not working here?



kryten2
Apr 1, 2012, 05:04 PM
Take a look at the Spotify dictionary in scripteditor to see
how to use it with Applescript.

Found this on Google :

PlayPause.scpt :

tell application "System Events"
set MyList to (name of every process)
end tell
if (MyList contains "Spotify") is true then
tell application "Spotify.app" to «event spfyPlPs»
end if

NextTrack.scpt :

tell application "System Events"
set MyList to (name of every process)
end tell
if (MyList contains "Spotify") is true then
tell application "Spotify.app" to «event spfyNext»
end if

PreviousTrack.scpt :

tell application "System Events"
set MyList to (name of every process)
end tell
if (MyList contains "Spotify") is true then
tell application "Spotify.app" to «event spfyPrev»
end if

Disclaimer : I don't use Spotify so I couldn't test these scripts.