Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Now with syntax!' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Now with syntax!
Authored by: raven42rac on Apr 23, '04 05:36:21PM

on perform_mail_action(info)
	tell application "Mail"
		set theMessages to |SelectedMessages| of info
		repeat with thisMessage in theMessages
			set AppleScript's text item delimiters to {""}
			set thisSender to sender of thisMessage as string
			set brkpos to offset of "<" in thisSender
			if (brkpos is greater than 1) then
				set thisSender to (text items 1 through (brkpos - 1)) of thisSender as string
				if thisSender contains "\"" then
					set AppleScript's text item delimiters to {"\""}
					set thisSender to text item 2 of thisSender as string
				end if
			else
				if (brkpos is equal to 1) then
					set thisSender to (text items 2 through -1) of thisSender as string
				end if
				set AppleScript's text item delimiters to {"@"}
				set thisSender to text item 1 of thisSender as string
			end if
			tell application "Finder" to say "Mail from " & thisSender
		end repeat
	end tell
end perform_mail_action


[ Reply to This | # ]