Created
November 21, 2011 16:16
-
-
Save yitsushi/1383102 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
-- 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