opbarnes.com

Fri, Nov 09 2007

GrowlMail and Leopard not getting along?! Here's a solution

Last weekend I upgraded to Mac OS X Leopard, and one thing that doesn't seem to work with Leopard is GrowlMail* (a Growl Extra). After missing Growl Notifications for Mail.app a lot, I decided to search for a solution. After some googling, I found this on Kevin Way's blog:

"I wanted a simple system that would notify me whenever I received an e-mail from somebody "important", but not for every new message that hit my inbox."

"I tried GrowlMail and Mail.Appetizer, but found them both unsatisfactory. I finally decided that what I really wanted was a growl message to appear for messages from selected recipients. Something with the name and the subject of the e-mail, like this..."

This seemed a lot like what I needed, with the exception of the only receiving notifications when email from "important" people arrived part. So, here are my slight changes to Kevin's instructions:

  • Open Main.app and add a rule named "GrowlMailScript":

If any of the conditions are met:
Every Message
Perform the following actions:
Run AppleScript: ~/AppleScripts/GrowlMailScript.scpt

Careful! When you're finished making your new rule, Mail.app asks you "Do you want to apply your rules to messages in selected mailboxes?" Be sure click the "Don't Apply" button! If you don't, you may be bombarded with a "new mail" notification for every email you've ever recieved all at one.

  • Open a finder window and create a folder called "AppleScripts" in your user folder (this new folder will be a sibling with "Documents").

  • Now, you'll need to create the "GrowlMailScript.scpt" script mentioned above. Fire up Script Editor and paste the following script into the edit window:

        on perform_mail_action(info)

            tell application "Mail" 

                set selectedMessages to |SelectedMessages| of info

                repeat with eachMessage in selectedMessages
                    set theSubject to subject of eachMessage
                    set theSender to sender of eachMessage

                    tell application "GrowlHelperApp" 

                        set the allNotificationsList to ¬
                            {"New Mail"}

                        set the enabledNotificationsList to ¬
                            {"New Mail"}

                        register as application ¬
                            "MailScript" all notifications allNotificationsList ¬
                            default notifications enabledNotificationsList ¬
                            icon of application "Mail" 

                        notify with name ¬
                            "New Mail" title ¬
                            "New Mail from " & theSender description ¬
                            theSubject application name "MailScript" 

                    end tell

                end repeat
            end tell
        end perform_mail_action
  • Save the script (using File->Save As... when the Script Editor is active in the menu bar) in your new "AppleScripts" folder with the name "GrowlMailScript.scpt".

You're done! Send yourself an email to test it out.

* Tested with GrowlMail 1.1.2

8 comment(s)

Lee Herman (link) wrote @ 24:24:10, Sat Nov 17, 2007


Thank you! This is wonderful. Works just great.

Jay Jones (link) wrote @ 20:6:45, Fri Nov 23, 2007


Beautiful... thank you!!!

Matt (email address hidden) wrote @ 14:51:43, Mon Nov 26, 2007


Thanks!

Noah K wrote @ 11:53:19, Sat Jan 19, 2008

Works like a charm!
Thanks a million. :)

Arno H (link) wrote @ 13:21:22, Thu Mar 20, 2008


Hey, very good idea. I just extended the AppleScript a bit and added the display of some of the email message to the Growl notification. I posted the extended script here: http://www.betaplane.org/index.php/2008/03/20/growlmail_on_leopard/ Maybe someone will find it useful...

bob wrote @ 12:29:2, Mon May 5, 2008


thx works great, and arno your extension to it including the subject was exactly what i needed next. helpful

alex r. wrote @ 13:47:23, Fri Jul 25, 2008


Thanks! I use the script with Growl 1.1.4. It works very good.

Ben (email address hidden) wrote @ 15:51:18, Wed Oct 22, 2008


Hey this is nice -- thanks! I'm using it because GrowlMail is still kind of wonky in various ways. One question, though -- any idea how to get applescript to recognize when a user (i.e. me) clicks on the growl notification, and show the appropriate mail when that happens?

Add a comment: