Nicholas Pike

Like nailing jelly to a wall…

Leopard: Growl and Mail.app

with one comment

The release of Leopard into the wild has broken a good bunch of useful third party apps - one of my favorite being GrowlMail, which gives notifications of new mail in Mail.app.

There’s currently no ETA from the Growl team as to when this will be fixed in Leopard, but with some clever use of AppleScript, you can basically mimic its basic functionality for now.

Create a new AppleScript with Script Editor

Paste the following into Script Editor, and save it somewhere in your home folder (I put mine in ~/AppleScripts/GrowlMail.scpt).

 

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

… and then create a new Mail Rule in Mail.app (You’ll find the Rule tab in Mail.app Preferences).

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

Written by npike

December 7th, 2007 at 11:34 am

Posted in leopard, osx

One Response to 'Leopard: Growl and Mail.app'

Subscribe to comments with RSS or TrackBack to 'Leopard: Growl and Mail.app'.

  1. Wow. Thank you so much for this, it works a treat. Growl (or really MailAppetizer) was so useful in 10.4 because I could work with the sound down and be notified of new messages. It’s even more necessary in Leopard if you use spaces!!!

    This is incredibly useful, thanks so much.

    John

    John Sparrow

    22 Feb 08 at 8:15 pm

Leave a Reply