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


Click here to return to the 'Scripts from Sal at Apple...' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Scripts from Sal at Apple...
Authored by: aaronfreimark on Jan 16, '04 10:14:30AM
I rolled the scripts above into a toggle script. I named this file "Toggle Show Flagged___cmd-\.scpt", but you can name it what you like...
if ViewerIsFiltered() then
	try
		tell application "Mail"
			activate
			tell the front message viewer
				set the visible messages to every message
			end tell
		end tell
	on error error_message
		display dialog error_message {"Cancel"} default button 1
	end try
else
	try
		tell application "Mail"
			activate
			tell the front message viewer
				set the visible messages to every message whose 
					flagged status is true
			end tell
		end tell
	on error error_message
		display dialog error_message {"Cancel"} default button 1
	end try
end if

on ViewerIsFiltered()
	try
		tell application "Mail"
			activate
			tell the front message viewer
				set numThere to count of messages  
					of the selected mailboxes
				set numShown to count of visible messages
			end tell
			
			if numShown = numThere then
				return false
			else
				return true
			end if
		end tell
	on error error_message
		display dialog error_message {"Cancel"} default button 1
	end try
end ViewerIsFiltered


[ Reply to This | # ]