--Thanks.
- Code: Select all
property myNotifications : {budAvail:{title:"Buddy Available", action:" is available"}, budUnavail:{title:"Buddy Unavailable", action:" went away"}, invitation:{title:"Invitation", action:" invites you to chat"}, textInvite:{title:"Text Invitation", action:" wants to chat"}, audInvite:{title:"Audio Invitation", action:" wants to talk"}, vidInvite:{title:"Video Invitation", action:" invites you to a video chat"}, generic:{title:"Generic", action:""}}
property myAppName : "iChat"
property shouldInit : true
if shouldInit then init()
using terms from application "iChat"
--on budAvail(bud)
on buddy became available bud
notify of (budAvail of myNotifications) by bud
end buddy became available
--end budAvail
--on budUnavail(bud)
on buddy became unavailable bud
notify of (budUnavail of myNotifications) by bud
end buddy became unavailable
--end budUnavail
on notify of notif by bud
set uName to full name of bud
--set uName to name of bud
set msg to uName & (action of notif)
set img to a reference to image of bud
growl(title of notif, msg, image of bud)
end notify
end using terms from
on growl(notif, descr, img)
tell application "GrowlHelperApp"
try
notify with name notif ¬
title notif ¬
description descr ¬
application name myAppName ¬
image img
on error
notify with name notif ¬
title notif ¬
description descr ¬
application name myAppName
end try
end tell
end growl
on init()
set shouldInit to false
set myNotificationList to {}
repeat with bar in myNotifications as list
copy title of bar to end of myNotificationList
end repeat
tell application "System Events"
if (count of (every process whose name is "GrowlHelperApp")) > 0 then
tell application "GrowlHelperApp"
register as application ¬
myAppName all notifications myNotificationList ¬
default notifications myNotificationList ¬
icon of application myAppName
end tell
end if
end tell
end init

