Skip to content

Instantly share code, notes, and snippets.

@tsykoduk
Created April 1, 2011 05:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tsykoduk/897781 to your computer and use it in GitHub Desktop.
Save tsykoduk/897781 to your computer and use it in GitHub Desktop.
Growl mail replacement
using terms from application "Mail"
on perform mail action with messages theMessages for rule theRule
set maxlen to 200
set the notificationList to {"new Mail"}
tell application "GrowlHelperApp"
register as application ¬
"myGrowlMail" all notifications notificationList ¬
default notifications notificationList ¬
icon of application "Mail"
--notify with name "new Mail" title "TEST title" description "langer text" application name "myGrowlMail"
end tell
tell application "Mail"
repeat with m in theMessages
set sub to m's subject
set sndr to m's sender
set msgtxt to m's content
if ((length of characters of msgtxt) > maxlen) then
set AppleScript's text item delimiters to ""
set msgtxt to (text items of characters 1 thru maxlen of msgtxt) & " ..."
end if
set msg to sub & " from " & sndr
tell application "GrowlHelperApp" to ¬
notify with name ¬
"new Mail" title msg ¬
description "" & msgtxt ¬
application name "myGrowlMail"
--do shell script "/usr/local/bin/growlnotify -I /Applications/Mail.app -m " & quoted form of msg & quoted form of msgtxt
end repeat
end tell
end perform mail action with messages
end using terms from
Steps:
1) Put this file file some where
2) Add a rule to mail to call it on each new mail coming in
3) Bask in glory
I stole this completely from here: http://hints.macworld.com/article.php?story=201012041205380
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment