Uso una combo di regole di Apple Mail, un AppleScript e Howl (un'altra app growl simile a Prowl menzionata sopra).
Assegna un nome alla regola Mail in questo modo: "growl-TestPost" come indicato in AppleScript, quindi imposta le considerazioni e attiva questo AppleScript per l'esecuzione. Quindi imposta lo stile di visualizzazione Growl per utilizzare quello di Howl (o Prowl).
Ecco AppleScript, sfortunatamente non ho informazioni sullo script dell'autore originale che ho modificato:
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