thedeplorableword by Tom Martin
some people have been saying that the growlmail plugin is broken with this new Safari 4 beta, mine has remained fine, since I’m not using the growlmail plugin. Just a simple AppleScript and a message rule.
Paste this into Script Editor and save it somewhere:
on perform_mail_action(info)
	
	tell application "Mail"
		
		set selectedMessages to |SelectedMessages| of info
		set theRule to |Rule| of info
		
		repeat with eachMessage in selectedMessages
			set theSubject to subject of eachMessage
			set theSender to sender of eachMessage
			
			tell application "GrowlHelperApp"
				
				set the allNotificationsList to ¬
					{"New Mail"}
				
				set the enabledNotificationsList to ¬
					{"New Mail"}
				
				register as application ¬
					"MailScript" all notifications allNotificationsList ¬
					default notifications enabledNotificationsList ¬
					icon of application "Mail"
				
				notify with name ¬
					"New Mail" title ¬
					"New Mail from " & theSender description ¬
					theSubject application name "MailScript"
				
			end tell
			
		end repeat
	end tell
end perform_mail_action

Next goto Mail -> Preferences -> Rules. Add Rule. “If any of the following conditions are met: Every Message. Perform the following actions Run AppleScript “path to that script your just saved”.
You can do some interesting stuff with the conditions to: like only post a growl update when someone from your AddressBook emails you, or to only show when thekitchen@dominos.co.uk says your pizza is on it’s way.

some people have been saying that the growlmail plugin is broken with this new Safari 4 beta, mine has remained fine, since I’m not using the growlmail plugin. Just a simple AppleScript and a message rule.

Paste this into Script Editor and save it somewhere:

on perform_mail_action(info)
	
	tell application "Mail"
		
		set selectedMessages to |SelectedMessages| of info
		set theRule to |Rule| of info
		
		repeat with eachMessage in selectedMessages
			set theSubject to subject of eachMessage
			set theSender to sender of eachMessage
			
			tell application "GrowlHelperApp"
				
				set the allNotificationsList to ¬
					{"New Mail"}
				
				set the enabledNotificationsList to ¬
					{"New Mail"}
				
				register as application ¬
					"MailScript" all notifications allNotificationsList ¬
					default notifications enabledNotificationsList ¬
					icon of application "Mail"
				
				notify with name ¬
					"New Mail" title ¬
					"New Mail from " & theSender description ¬
					theSubject application name "MailScript"
				
			end tell
			
		end repeat
	end tell
end perform_mail_action

Next goto Mail -> Preferences -> Rules. Add Rule. “If any of the following conditions are met: Every Message. Perform the following actions Run AppleScript “path to that script your just saved”.

You can do some interesting stuff with the conditions to: like only post a growl update when someone from your AddressBook emails you, or to only show when thekitchen@dominos.co.uk says your pizza is on it’s way.

  1. eldoggrag reblogged this from deplorableword
  2. bravefacari reblogged this from deplorableword
  3. jhnbrssndn reblogged this from deplorableword
  4. deplorableword posted this