Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- property onlineBuddies : 0
- using terms from application "iChat"
- on received text invitation theMessage from theBuddy for theChat
- accept theChat
- my registerWithGrowl()
- tell application "iChat"
- set theIcon to theBuddy's image
- set theName to theBuddy's full name
- end tell
- my growlNotify(theName, theMessage, theIcon, "Message Received")
- end received text invitation
- on message received theMessage from theBuddy for theChat
- my registerWithGrowl()
- tell application "iChat"
- set theIcon to theBuddy's image
- set theName to theBuddy's full name
- end tell
- my growlNotify(theName, theMessage, theIcon, "Message Received")
- end message received
- on buddy became available theBuddy
- if window "iChat Buddies" of application "iChat" is visible then
- delay 0.4
- if zoomed of window "iChat Buddies" of application "iChat" is false then
- set prezoomedWindowBounds to bounds of window "iChat Buddies" of application "iChat"
- set zoomed of window "iChat Buddies" of application "iChat" to true
- set postzoomedWindowBounds to bounds of window "iChat Buddies" of application "iChat"
- if (the bounds of window "iChat Buddies" of application "iChat" is not equal to {item 1 of prezoomedWindowBounds, item 2 of prezoomedWindowBounds, item 3 of prezoomedWindowBounds, item 4 of postzoomedWindowBounds}) then
- set bounds of window "iChat Buddies" of application "iChat" to {item 1 of prezoomedWindowBounds, item 2 of prezoomedWindowBounds, item 3 of prezoomedWindowBounds, item 4 of postzoomedWindowBounds}
- end if
- end if
- end if
- end buddy became available
- on buddy became unavailable theBuddy
- if window "iChat Buddies" of application "iChat" is visible then
- delay 2.2
- if zoomed of window "iChat Buddies" of application "iChat" is false then
- set prezoomedWindowBounds to bounds of window "iChat Buddies" of application "iChat"
- set zoomed of window "iChat Buddies" of application "iChat" to true
- set postzoomedWindowBounds to bounds of window "iChat Buddies" of application "iChat"
- if (the bounds of window "iChat Buddies" of application "iChat" is not equal to {item 1 of prezoomedWindowBounds, item 2 of prezoomedWindowBounds, item 3 of prezoomedWindowBounds, item 4 of postzoomedWindowBounds}) then
- set bounds of window "iChat Buddies" of application "iChat" to {item 1 of prezoomedWindowBounds, item 2 of prezoomedWindowBounds, item 3 of prezoomedWindowBounds, item 4 of postzoomedWindowBounds}
- end if
- end if
- end if
- end buddy became unavailable
- on login finished
- end login finished
- on logout finished
- end logout finished
- end using terms from
- on registerWithGrowl()
- tell application "System Events"
- set growlIsRunning to ¬
- (count of (every process whose bundle identifier is "com.Growl.GrowlHelperApp")) > 0
- end tell
- if growlIsRunning then
- tell application id "com.Growl.GrowlHelperApp"
- set the allNotificationsList to ¬
- {"Message Received"}
- set the enabledNotificationsList to allNotificationsList
- (*set the enabledNotificationsList to ¬
- {"Message Received"}*)
- register as application ¬
- "iChat" all notifications allNotificationsList ¬
- default notifications enabledNotificationsList ¬
- icon of application "iChat"
- end tell
- end if
- end registerWithGrowl
- on growlNotify(eventTitle, eventDescription, eventImage, eventName)
- tell application "System Events"
- set growlIsRunning to ¬
- (count of (every process whose bundle identifier is "com.Growl.GrowlHelperApp")) > 0
- end tell
- if growlIsRunning then
- tell application id "com.Growl.GrowlHelperApp"
- if eventImage is "" or eventImage is missing value then
- notify with name ¬
- eventName title ¬
- eventTitle description ¬
- eventDescription application name ¬
- "iChat" icon of application "iChat"
- else
- notify with name ¬
- eventName title ¬
- eventTitle description ¬
- eventDescription application name ¬
- "iChat" image eventImage
- end if
- end tell
- end if
- end growlNotify
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement