- open the script editor and copy the code below into a new script
- run it once from the script editor to register the script with growl (you can now configure it in Growl's system preferences)
- save it to disk (the file name and location are not relevant, but it's probably best to put it in the mail scripts folder - ~/Library/Scripts/Applications/Mail)
- Open Mail preferences and create a new rule with the condition "every message" and the action "run applescript" with a link to the script you just saved
in some ways this might be much more versatile than GrowlMail, though I'm not sure what problems will crop up with it. if you try it, tell me what goes wrong or what you'd like it to do instead, and I'll try to revise it.
- Code: Select all
tell application "GrowlHelperApp"
set the allNotificationsList to {"Mail", "Junk Mail"}
set the enabledNotificationsList to {"Mail", "Junk Mail"}
register as application "Growl Mail Rule" all notifications allNotificationsList ¬
default notifications enabledNotificationsList ¬
icon of application "Script Editor"
end tell
using terms from application "Mail"
on perform mail action with messages messageList
repeat with thisMessage in messageList
set theSender to sender of thisMessage
set theSubject to subject of thisMessage
if junk mail status of thisMessage is true then
set noteType to "Junk Mail"
else
set noteType to "Mail"
end if
tell application "GrowlHelperApp" to notify with name noteType ¬
title noteType description ¬
"From: " & theSender & return & return & "Subject: " & theSubject ¬
application name "Growl Mail Rule"
end repeat
end perform mail action with messages
end using terms from


