CODE: IRC Notifier

This is some more of the Applescript I’ve been poking around with: this one notifies for IRC. So far I have it established how to notify someone when a user enters/exits, I have no idea how to notify on keyword, response, etc… This requires Applescript on any version of Mac OS X and Growl. Code follows…


using terms from application "Colloquy"

on member joined whoArrived
set messageTitle to "IRC User Entered"
set n to (whoArrived's name)
set showMessage to (n & " has entered the room!")
set nName to "IRC Enter"
notifyMe(messageTitle, showMessage, nName)

end member joined

on member parted whoLeft
set messageTitle to "IRC User Left"
set n to (whoLeft's name)
set showMessage to (n & " has left the building!")
set nName to "IRC Leave"
notifyMe(messageTitle, showMessage, nName)

end member parted

on perform notification
set showMessage to notification with record
set messageTitle to "IRC Channel Notice"
set nName to "IRC"
notifyMe(showMessage, messageTitle, nName)
end perform notification

end using terms from

on notifyMe(messageTitle, showMessage, nName)
tell application "GrowlHelperApp"

set the allNotificationsList to ¬
{"IRC Enter", "IRC Leave", "IRC"}

set the enabledNotificationsList to ¬
{"IRC Enter", "IRC Leave", "IRC"}

register as application ¬
"Growl AppleScript Sample" all notifications allNotificationsList ¬
default notifications enabledNotificationsList ¬
icon of application "Colloquy"

-- Send a Notification...
notify with name ¬
nName title ¬
messageTitle description ¬
showMessage application name "Growl AppleScript Sample"

end tell
end notifyMe

I accept no responsibility for what you chose to do with this.