Skip to content

Instantly share code, notes, and snippets.

@gaza3g
Created November 5, 2012 07:00
Show Gist options
  • Save gaza3g/4015718 to your computer and use it in GitHub Desktop.
Save gaza3g/4015718 to your computer and use it in GitHub Desktop.
spotify in Messages.app status
#taken from user "pinyourwings22"
#at http://forums.macrumors.com/showthread.php?t=1418925
on idle
tell application "Spotify"
set theTrack to current track
set theArtist to artist of theTrack
set theName to name of theTrack
if player state is playing then
set playStatus to "playing"
else
set playStatus to "notPlaying"
end if
end tell
tell application "Messages"
if status is available then
if playStatus is "playing" then
if (theArtist as string) is not "Spotify" then
set status message to ("♫ Playing in Spotify: " & (theArtist as string) & " - " & (theName as string))
end if
else
set status message to "Available"
end if
end if
end tell
return 5
end idle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment