在 OSX 更新到 Yosemite 后,Applescript 到 "tell" Spotify 无法播放

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

在 Yosemite 更新之前,我使用 this Applescript 来控制我的 Spotify。

当我 运行 /usr/bin/osascript /Users/jdrummond/SpotifyControl.scpt play/pause.

时,一切都变得很有魅力

现在我已经将我的 OSX 更新为 Yosemite,当我 运行 相同的命令时,我不断得到这个:

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

所以我尝试创建一个简单的 Applescript 来与 Spotify 交互:

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

但我也遇到了错误:

我做错了什么以及如何在 Yosemite 上与 Spotify 互动?有什么变化吗?

Spotify 最近通过其最新的愚蠢更新破坏了使用 AppleScript 的能力。不是 Yosemite,是 Spotify。

此问题已报告给 Spotify,将在桌面客户端的下一次更新中得到修复(我是那里的开发人员,可以验证它已得到修复)。

目前,以下简单脚本适用于 OS X 10.9.5、Spotify 1.0.3.101.gbfa97dfe

tell application "Spotify"
    playpause
end tell

我将它保存为其他应用程序以便与我的 Microsoft 键盘一起使用,因此 play/pause 按钮可以启动 plays/pauses.

的简单应用程序