Skip to content

Instantly share code, notes, and snippets.

@chetan
Created February 11, 2010 15:45
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 chetan/301630 to your computer and use it in GitHub Desktop.
Save chetan/301630 to your computer and use it in GitHub Desktop.
entourage growl notification
(*
Public Domain, 2010
Chetan Sarva <csarva@pixelcop.net>
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