Growl Notifications for iCal (Tiger only)

This only works in Mac OS X Tiger 10.4

I’m still working on an updated version for Leopard.

I love iCal, but I really hate the giant reminder panel stealing focus and getting in the way. Ewww.

I love Growl. There was an obvious need for a way to do iCal Growl notifications.

iCal has a nice feature where you can run an applescript using the Open File… feature in the alarm thing. The problem with this is that it doesn’t send any applescript variables to the script. So you would have to either do a generic alert for every reminder or have a separate script for each reminder. This is not hip, nor DRY.

I went searching for a solution to this and came across the article iCal and Growl @ where he shows you how to hack the internal applescript file that handles sending an Email on an alarm. This is totally awesome! You get access to all of the variables and can do the Growl. The only problem with his method is that it removes your ability to ever send another Email Alarm again.

I took his idea and added a simple if filter to the applescript. It works by checking for the email address “Growl”. If it sees that address then it does a Growl thinggy, otherwise it does the email like normal.

Download the Scripts

iCal Mail Script (with Growl Support)

How to Install & Use

  1. Add the email address “Growl”

    to your personal Address Book entry.
    • (Mark it as secret if you have that feature enabled.)
  2. Copy Mail.scpt into the iCal resources.
    • /Applications/
  3. Copy Mail.scpt into the iCalHelper resources.
    • /Applications/
  4. Quit iCal
    • You should Quit iCalAlarmScheduler too,
    • or you can log out and back in.
  5. Make a new iCal Event
  6. Make a new Email Alarm on that event
    1. Set the email address to “Growl”

Here is the actual code:

on send_mail_sbr(subjectLine, messageText, myrecipient)
	if myrecipient = "Growl" then
		send_mail_sbr_GROWL(subjectLine, messageText, myrecipient)
		send_mail_sbr_EMAIL(subjectLine, messageText, myrecipient)
	end if
end send_mail_sbr

on send_mail_sbr_EMAIL(subjectLine, messageText, myrecipient)
	tell application "Mail"
		set mymail to (make new outgoing message at the beginning of outgoing messages with properties {subject:subjectLine, content:messageText})
		tell mymail to make new to recipient at beginning of to recipients with properties {address:myrecipient}
		send mymail
	end tell
end send_mail_sbr_EMAIL

on send_mail_sbr_GROWL(subjectLine, messageText, myrecipient)
	tell application "GrowlHelperApp"
		set theName to "New Event"
		set theAppName to "Custom iCal Notifications"
		set the allNotificationsList to {theName}
		set the enabledNotificationsList to {theName}

		register as application theAppName ¬
			all notifications allNotificationsList ¬
			default notifications enabledNotificationsList ¬
			icon of application "iCal"
		notify with name theName ¬
			title subjectLine ¬
			description messageText ¬
			application name theAppName ¬
			with sticky
	end tell
end send_mail_sbr_GROWL