Skip to content

Instantly share code, notes, and snippets.

@yitsushi
Created November 21, 2011 16:16
Show Gist options
  • Save yitsushi/1383102 to your computer and use it in GitHub Desktop.
Save yitsushi/1383102 to your computer and use it in GitHub Desktop.
-- Show current song
-- by Balazs Nadasdi
set the enabledNotification to {"iTunes Current Song"}
tell application "System Events"
set isGrowlRunning to (count of (every process whose bundle identifier is "com.Growl.GrowlHelperApp")) > 0
set isiTunesRunning to (count of (every process whose bundle identifier is "com.apple.iTunes")) > 0
end tell
if isiTunesRunning then
tell application "iTunes"
try
if not (exists current track) then return
set this_artist to (get artist of current track)
set this_track to (get name of current track)
set this_album to (get album of current track)
end try
end tell
end if
if isGrowlRunning and isiTunesRunning then
tell application id "com.Growl.GrowlHelperApp"
register as application ¬
"Growl AppleScript to show current track of iTunes" all notifications enabledNotification ¬
default notifications enabledNotification ¬
icon of application "iTunes"
notify with name ¬
"iTunes Current Song" title ¬
this_track description ¬
this_artist & " - " & this_album application name "Growl AppleScript to show current track of iTunes"
end tell
end if
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment