Return to Snippet

Revision: 21394
at December 11, 2009 13:08 by jodm


Initial Code
tell application "GrowlHelperApp"
	set the allNotificationsList to {"Mail", "Junk Mail"}
	set the enabledNotificationsList to {"Mail", "Junk Mail"}
	register as application "Growl Mail Rule" all notifications allNotificationsList ¬
		default notifications enabledNotificationsList ¬
		icon of application "Script Editor"
end tell

using terms from application "Mail"
	on perform mail action with messages messageList
		repeat with thisMessage in messageList
			set theSender to sender of thisMessage
			set theSubject to subject of thisMessage
			if junk mail status of thisMessage is true then
				set noteType to "Junk Mail"
				
			else
				set noteType to "Mail"
			end if
			tell application "GrowlHelperApp" to notify with name noteType ¬
				title noteType description ¬
				"From: " & theSender & return & return & "Subject: " & theSubject ¬
				application name "Growl Mail Rule"
		end repeat
	end perform mail action with messages
end using terms from

Initial URL


Initial Description


Initial Title
Mac Mail - Growl

Initial Tags
mail

Initial Language
AppleScript