Developers
This page is for developers of media apps who would like to add compatibility with Sleeve. If you want your app to be considered for Sleeve integration please contact us.
Integrating with Sleeve
Sleeve accesses music apps via AppleScript events. To add compatibility with Sleeve, the following methods must be implemented, and you'll need to contact us so we can add your app as an option in Sleeve's interface.
The following sections show how we request the currently playing track information, and then how we send events to control playback, where your app is named YourApp
.
Current Track
TrackID: (Returns string - a unique identifier for the track)
tell application YourApp to get id of current track
Track name: (Returns string)
tell application YourApp to get name of current track
Artist name: (Returns string)
tell application YourApp to get artist of current track
Album name: (Returns string)
tell application YourApp to get album of current track
Album artwork: (Returns string, data)Spotify returns a URL to the album artwork whereas Apple Music serves Image Data directly to us.
Spotify example;
tell application "Spotify" to get artwork url of current track
Apple Music example;
tell application "Music" to get data of first artwork of current track
YourApp is playing music: (Returns playing
as string if true)
tell application YourApp to get player state as string
Playback Control
Playback controls all follow the same syntax. The following states can be passed;
play
pause
next track
previous track
tell application YourApp to `state`
Loving tracks
Get track loved state: (Returns Bool)
tell application YourApp to get loved of current track
Set track loved state: (Bool)
tell application YourApp to set loved of current track to true