Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --iTunes talks to growl (pre-alpha) ;)
- --register notification with growl (only needed one time)
- tell application "GrowlHelperApp"
- register as application "iTunesNotify" all notifications {"iTunesTrackNotify"} default notifications {"iTunesTrackNotify"} icon of application "itunes.app"
- end tell
- --let iTunes send notifications
- tell application "iTunes"
- set iTunesNotifiedID to -1
- repeat
- try
- --send current track name and album to prowl
- if player state = playing then
- if database ID of current track is not equal to iTunesNotifiedID then
- set iTunesTitle to name of current track as text
- set iTunesAlbum to album of current track as text
- tell application "GrowlHelperApp"
- notify with name "iTunesTrackNotify" title iTunesTitle description iTunesAlbum application name "iTunesNotify"
- end tell
- set iTunesNotifiedID to database ID of current track
- end if
- delay 1
- end if
- --other notifications go here
- on error number -609
- --exit the loop when the user quits iTunes
- exit repeat
- end try
- end repeat
- end tell
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement