Created
October 6, 2011 02:34
-
-
Save seancoyne/1266357 to your computer and use it in GitHub Desktop.
Applescript for iChat Growl (1.3) Notifications
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
| on notify_growl(theName, theTitle, theDescription, theImage) | |
| tell application "Growl" | |
| if (theImage is not null) then | |
| notify with name theName title theTitle description theDescription application name "iChat" image theImage | |
| else | |
| notify with name theName title theTitle description theDescription application name "iChat" | |
| end if | |
| end tell | |
| end notify_growl | |
| using terms from application "iChat" | |
| -- register the app with growl | |
| tell application "Growl" | |
| set the allNotificationsList to {"Message Received"} | |
| set the enabledNotificationsList to {"Message Received"} | |
| register as application "iChat" all notifications allNotificationsList default notifications enabledNotificationsList icon of application "Messages" | |
| end tell | |
| -- handle the iChat events | |
| on message received theMessage from theBuddy for theChat | |
| if ((application "iChat" is not frontmost) or (status of application "iChat" is equal to away)) then | |
| try | |
| notify_growl("Message Received", "Message Received from " & name of theBuddy, theMessage, image of theBuddy) | |
| on error | |
| notify_growl("Message Received", "Message Received from " & name of theBuddy, theMessage, null) | |
| end try | |
| end if | |
| end message received | |
| on received text invitation theMessage from theBuddy for theChat | |
| accept theChat | |
| if ((application "iChat" is not frontmost) or (status of application "iChat" is equal to away)) then | |
| try | |
| notify_growl("Message Received", "Message Received from " & name of theBuddy, theMessage, image of theBuddy) | |
| on error | |
| notify_growl("Message Received", "Message Received from " & name of theBuddy, theMessage, null) | |
| end try | |
| end if | |
| end received text invitation | |
| end using terms from |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
updated to support Messages beta and to handle missing buddy images