Created
November 5, 2012 07:00
-
-
Save gaza3g/4015718 to your computer and use it in GitHub Desktop.
spotify in Messages.app status
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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