AppleScript Programming/Mail alert

From Wikibooks, the open-content textbooks collection

Jump to: navigation, search

Note: the following will bring your volume low after raising it with the alert.

From anyone (at "Tools->Rules", create a new rule, add criterion such as "Is not junk email", and for an action, choose "Run AppleScript", selecting the script file for the script below):

tell application "Microsoft Entourage"
	set volume 10
	say "You've got mail!"
	set volume 1
end tell

From a specific person (at "Tools->Rules", create a new rule, add criterion such as "From"+"Contains"->bob@yahoo.com, and for an action, choose "Run AppleScript", selecting the script file for the script below):

tell application "Microsoft Entourage"
	set volume 10
	say "You've got mail from Bob!"
	set volume 1
end tell