Uso un combo de reglas de Apple Mail, AppleScript y Howl (otra aplicación de gruñidos similar a Prowl mencionada anteriormente).
Asigne un nombre a la regla del correo como tal: "growl-TestPost" como se indica en el AppleScript, luego configure las condiciones y active este AppleScript para que se ejecute. Luego configura tu estilo de visualización Growl para usar el de Howl (o Prowl).
Aquí está el AppleScript, desafortunadamente no tengo información sobre el script del autor original que modifiqué:
on run
-- at current, the registration is done whenever you launch the script,
-- and also below whenever the the script itself is run by Mail
-- (that let's users make new notification on the fly, sort of...)
-- could probably find a more graceful semaphor, but...
register()
end run
using terms from application "Mail"
on perform mail action with messages messageList for rule theRule
set theRuleName to name of theRule
if theRuleName does not start with "growl-" then return
register()
-- extract notification type from rule name
set noteType to characters 7 thru (length of theRuleName) of theRuleName as text
repeat with thisMessage in messageList
-- basic information for notification
set theSender to sender of thisMessage
set theSubject to subject of thisMessage
set theText to (content of thisMessage)
set tid to AppleScript's text item delimiters
set AppleScript's text item delimiters to " "
try
set theSummary to (text items 1 through 20 of theText) as text
on error
set theSummary to theText
end try
set AppleScript's text item delimiters to tid
-- notify
tell application "GrowlHelperApp" to notify with name noteType ¬
title noteType description ¬
"From: " & theSender & return & "Subject: " & theSubject ¬
application name "MailGrowl"
end repeat
-- if we want to coalesce or order the notifications, then we'd put the
-- notifications into an array above and notify GHA here. I'm not completely
-- on the structures that are required for grouped messages, though..
end perform mail action with messages
end using terms from
to register()
tell application "Mail"
set ruleList to name of every rule whose name begins with "growl"
end tell
set noteTypes to {}
repeat with theRuleName in ruleList
set end of noteTypes to (characters 7 thru (length of theRuleName) of theRuleName as text)
end repeat
tell application "GrowlHelperApp"
register as application "MailGrowl" all notifications noteTypes ¬
default notifications noteTypes ¬
icon of application "Mail"
end tell
end register