Remote control API for Spotify?

别来无恙 提交于 2019-12-10 13:42:46

问题


Is there such a thing as a Spotify remote control API? I want to write an app which lets the user control the Spotify desktop client (play, pause, volume, playlists, etc.) but I can't seem to find any documentation anywhere.

There are iOS and Android remote control apps out there so I'm just wondering how they do it if there isn't an API.


回答1:


On Mac OS X, Spotify can be controlled 'remotely' (i.e. from other apps) using AppleScript, either using the bundled API or the System Events service.

Here's an example of using the bundled API: https://github.com/activars/spotify-applescript/blob/master/spotify_control.applescript

And another one using System Events (it isn't quite as elegant): http://www.jacktams.net/2010/04/28/spotify-applescripts-version-0-4-3/

Official documentation is a bit thin, although you should be able to use the AppleScript editor's library feature to find out more about the methods offered.



来源:https://stackoverflow.com/questions/12337685/remote-control-api-for-spotify

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!