Alternative to GrowlMail

Every time Apple releases an OS update, GrowlMail breaks. It’s been weeks since Mail 4.4 was released but GrowlMail has yet to be updated to work with the new version. I began poking around the Internets for an alternative and I found a pretty clever work around over at Macworld.com that I want to share.

It requires you to create an AppleScript then create a filter within mail to point to the aforementioned AppleScript. You’ll also need to have Growl already installed with the “growlnotify” plugin in the “Extras” section of the Growl disk image.

First open up the AppleScript Editor (You can find this quickly by doing a spotlight search). Then copy and paste the code below into the body and save it as a script. Save it to a spot where you won’t touch it. I saved it to /Library/Mail/Scripts/. I added the “Scripts” folder so that I can easily find it if I need to.

UPDATE: @frankhsueh has alerted me that there’s actually a folder in the Library that’s dedicated to Mail Scripts. It’s located in /Library/Scripts/Mail Scripts. Thanks for the tip, Frank!

using terms from application "Mail"
	on perform mail action with messages theMessages for rule theRule
		set maxlen to 200

		set the notificationList to {"new Mail"}
		tell application "GrowlHelperApp"
			register as application ¬
				"myGrowlMail" all notifications notificationList ¬
				default notifications notificationList ¬
				icon of application "Mail"
	--notify with name "new Mail" title "TEST title" description "langer text" application name "myGrowlMail"
	end tell

	tell application "Mail"
		repeat with m in theMessages
		set sub to m's subject
		set sndr to m's sender
		set msgtxt to m's content
		if ((length of characters of msgtxt) > maxlen) then
			set AppleScript's text item delimiters to ""
			set msgtxt to (text items of characters 1 thru maxlen of msgtxt) & " ..."
		end if
			set msg to sub & " from " & sndr

		tell application "GrowlHelperApp" to ¬
			notify with name ¬
			"new Mail" title msg ¬
			description "" & msgtxt ¬
			application name "myGrowlMail"

	--do shell script "/usr/local/bin/growlnotify -I /Applications/Mail.app -m " & quoted form of msg & quoted form of msgtxt
	end repeat
	end tell
	end perform mail action with messages
end using terms from

Then go into the Mail application and create a filter with for “Every Message,” then choose to “Run AppleScript” and finally, select the script that you just created.

Create a filter in Mail

You’re all set from here. You can test if it works by sending yourself an email. This should continue to work even if Apple decides to update the Mail application. Yay! No more waiting around for GrowlMail to be updated to work with the most current version of Mail.

2 thoughts on “Alternative to GrowlMail”

  1. Thanks a bunch! I really appreciate this script. I’m working with 10.7, so Growl isn’t updating for this OS yet. Works great! Could you maybe post a tutorial about how to change the “title” and “message” of the Growl notification? I’d like the title to be “New Message”, and the body of the notification to be “From: [from] \n Msg: [truncated msg]”.

    1. I’m glad my post helped you out! I actually didn’t write the script, as I have noted in the post. It was written by an anonymous user so unfortunately I can’t point you out to someone that can help you with modifying the code. :(

Leave a Reply to Adam Cancel reply

Your email address will not be published. Required fields are marked *