Hey Guys,
Has there been any updates on a Spotify Plugin? Is there anyone that has integrated Spotify?
Thanks!
- Zack
set playState to "blahblahblah"
tell application "Spotify"
set trackID to id of current track
set trackPosition to player position
if player state is playing then
set playState to "Playing"
else if player state is paused then
set playState to "Paused"
else if player state is stopped then
set playState to "Paused"
end if
end tell
tell application "IndigoServer"
set Secs to trackPosition mod 60 as integer
set Mins to trackPosition div 60 as integer
if Secs is 60 then
set Secs to 0
set Mins to Mins + 1
end if
if Secs is less than 10 then set Secs to "0" & Secs as string
set Secs to Secs as string
set value of variable "SpotifyCurrentPosition" to trackPosition as integer
set value of variable "SpotifyCurrentPositionHuman" to (Mins as string) & ":" & (Secs as string)
end tell
if playState is "Playing" then
set value of variable "SpotifyCurrentPlaystate" to "Playing"
else if playState is "Paused" then
set value of variable "SpotifyCurrentPlaystate" to "Paused"
else if playState is "Stopped" then
set value of variable "SpotifyCurrentPlaystate" to "Stopped"
else
set value of variable "SpotifyCurrentPlaystate" to "Unknown"
end if
if value of variable "SpotCurrentID" is not trackID then
set value of variable "SpotCurrentID" to trackID
tell application "Spotify"
set trackName to name of current track
set albumName to album of current track
set artistName to artist of current track
end tell
log trackName & " by " & artistName & " from album " & albumName & " played"
set value of variable "SpotCurrentTrack" to trackName
set value of variable "SpotCurrentAlbum" to albumName
set value of variable "SpotCurrentArtist" to artistName
tell application "Spotify"
set aTrack to current track
set aTrackArtwork to null
end tell
--begin album art script
set ArtworkFromSpotify to "Server SSD:Library:WebServer:Documents:albumArt.jpg" as alias
set SpotifyArtwork to "Server SSD:Library:WebServer:Documents:albumArt.jpg"
-- Unix versions of the above path strings
set unixSpotifyArtwork to the quoted form of POSIX path of SpotifyArtwork
tell application "Spotify"
set aTrack to current track
set aTrackArtwork to null
set aTrackArtwork to artwork of aTrack
set fileRef to (open for access ArtworkFromSpotify with write permission)
try
write aTrackArtwork to fileRef
close access fileRef
end try
end tell
--end album art script
end if
tell application "Spotify"
play
pause
next track
previous track
//anything else you can find in the applescript dictionary for spotify :p
end tell
tell application "Spotify"
set shuffling to true
play track "spotify:user:spotify:playlist:70P6cQQiiswZWudBTHPBp7"
next track
end tell
It also uses the apache server built into OS X, saving the album art to "albumArt.jpg", allowing me to use it as a refreshing image URL in a control page. (Except the most recent spotify update seems to have broken this functionality. The resultant file won't open and doesn't display properly - don't know if anyone has any idea why here?
Macintosh HD:Library:Application Support:Perceptive Automation:Indigo 6:IndigoWebServer:images:backgrounds:albumArt.jpg
bkmar1192 wrote:Is anyone actively working on a Spotify plugin using the Spotify API? It is the next project on my list but don't want to start if something is already in development.
Sent from my iPhone using Tapatalk
Stoutjesdijk wrote:If I wanted to get the album art from Spotify, is there any way I can display that album art through the Sonos plugin? Once I start a spotify playlist (from my phone), the Indigo controls all work, but the album art is not updated...
Users browsing this forum: No registered users and 3 guests