Guest User

GROWL: MAIL NOTIFICATION

a guest
Oct 19th, 2011
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #APPLE-SCRIPT GROWL NOTIFICATION FOR APPLE MAIL (10.6/10.7)
  2. #create an filter which fires this script when new mail arrives
  3.  
  4. #only needed one time - growl registration - put in a separate file
  5.  
  6. tell application "Growl"
  7.     register as application "MailNotify" all notifications {"newMailNotify"} default notifications {"newMailNotify"} icon of application "mail.app"
  8. end tell
  9.  
  10. #the notification script - also to put in a separate file
  11.  
  12. using terms from application "Mail"
  13.    
  14.     on perform mail action with messages mlist for rule Notification
  15.        
  16.         set msub to subject of item 1 of mlist
  17.         set msnd to sender of item 1 of mlist
  18.         set msnd to extract name from (msnd)
  19.        
  20.         tell application "Growl"
  21.            
  22.             notify with name "newMailNotify" title msub description msnd application name "MailNotify"
  23.            
  24.         end tell
  25.        
  26.     end perform mail action with messages
  27.    
  28. end using terms from
  29.  
  30.  
Advertisement
Add Comment
Please, Sign In to add comment