Created
February 11, 2010 15:45
-
-
Save chetan/301630 to your computer and use it in GitHub Desktop.
entourage growl notification
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* | |
Public Domain, 2010 | |
Chetan Sarva <[email protected]> | |
http://chetanislazy.com/ | |
See also: | |
http://blog.entourage.mvps.org/2009/02/use_growl_with_entourage.html (original, help) | |
http://blog.geekdaily.org/2007/12/growl-for-entou.html (another script, borrowed some ideas) | |
*) | |
tell application "GrowlHelperApp" | |
set the allNotificationsList to {"New Mail"} | |
set the enabledNotificationsList to {"New Mail"} | |
register as application ¬ | |
"Entourage" all notifications allNotificationsList ¬ | |
default notifications enabledNotificationsList ¬ | |
icon of application "Microsoft Entourage" | |
end tell | |
if frontmost is false then | |
tell application "Microsoft Entourage" | |
set theMessages to the current messages | |
end tell | |
repeat with theMsg in theMessages | |
tell application "Microsoft Entourage" | |
set mysubject to get the subject of theMsg | |
set mybody to get the content of theMsg | |
if mybody is "" then | |
set myshortbody to "<no body>" | |
else if length of mybody ≥ 250 then | |
set myshortbody to text 1 thru 250 of mybody | |
else | |
set myshortbody to mybody | |
end if | |
set mysender to the display name of sender of theMsg as string | |
if mysender is "" then | |
set mysender to the address of sender of theMsg as string | |
end if | |
end tell | |
tell application "GrowlHelperApp" | |
notify with name "New Mail" title (mysubject) description ("From: " & mysender & " | |
" & myshortbody) application name "Entourage" | |
end tell | |
end repeat | |
end if (* frontmost is false *) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment