Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Applescript to "tell" Spotify to play isn't working after OSX update to Yosemite

Previously to the Yosemite update, I used this Applescript to control my Spotify.

Everything worked as a charm when I ran /usr/bin/osascript /Users/jdrummond/SpotifyControl.scpt play/pause.

Now that I have updated my OSX to Yosemite, I keep getting this when I run the same command:

/Users/jdrummond/SpotifyControl2.scpt:1217:1222: script error: Expected end of line, etc. but found identifier. (-2741)

So I tried to create a simple Applescript to interact with Spotify:

using terms from application "Spotify"
    tell application "Spotify" to play
end using terms from

But I'm also getting an error:

Error

What am I doing wrong and how to interact with Spotify on Yosemite? Anything changed?

like image 850
dmmd Avatar asked Mar 13 '15 18:03

dmmd


2 Answers

This issue was reported to Spotify and will be fixed in the next update to the desktop client (I'm a developer there and can verify that it has been fixed).

like image 145
Nik Reiman Avatar answered Nov 01 '22 05:11

Nik Reiman


Currently, the following simple script is working for me on OS X 10.9.5, Spotify 1.0.3.101.gbfa97dfe

tell application "Spotify"
    playpause
end tell

I saved it as an app in other to use with my Microsoft Keyboard, so that the play/pause button launches the simple app that plays/pauses.

like image 28
Kyle Avatar answered Nov 01 '22 07:11

Kyle