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


Click here to return to the 'Show summaries of Mail's flagged emails on the Desktop ' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Show summaries of Mail's flagged emails on the Desktop
Authored by: dwpoyner on May 13, '10 03:20:13PM
Ok, so I worked with the script just a bit in order to keep it from opening Mail every time it wants to run. I also added in the received time of the message for reference. The data is not persistent though if Mail is not open. Maybe someone else can help me with that. I have no clue how to make that happen.

tell application "System Events" to set MailIsRunning to (count of (every process whose name is "Mail")) > 0


if MailIsRunning then
	
	set newline to ASCII character 10
	
	set finalText to "Flagged Mail:" & newline
	tell application "Mail"
		set theMessages to every message in inbox whose flagged status is true
		repeat with i from 1 to number of items in theMessages
			set thisMessage to item i of theMessages
			set fromMsg to (sender of thisMessage as string)
			set subjMsg to (subject of thisMessage as string)
			set timeMsg to (date received of thisMessage as string)
			set finalText to finalText & "! " & word 1 of fromMsg & ": " & subjMsg & "" & timeMsg & newline
		end repeat
	end tell
	
else
	return
end if
finalText


[ Reply to This | # ]