GeekTools to show iTunes current song
I wanted to display the current song playing on my desktop using GeekTools. I found some info on accomplishing this with AppleScript here. Pretty straightforward, but their script is clever in that I think it only runs if iTunes is running. I modified the script a bit, here’s what I have:
tell application "System Events"
set powerCheck to ((application processes whose (name is equal to "iTunes")) count)
if powerCheck = 0 then
return ""
end if
end tell
tell application "iTunes"
try
set playerstate to (get player state)
end try
if playerstate = stopped then
return "Stopped"
end if
set trackID to the current track
set trackName to the name of trackID
set artistName to the artist of trackID
set albumName to the album of trackID
set totalData to artistName & "
" & albumName & "
" & trackName
return totalData
end tell