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: kmue on Jan 16, '04 03:05:51AM
Very sleek code! Unfortunately the error messag did not work (on Panther)

on error error_message
  display dialog error_message("Cancel") default button 1
though its possible to leave it out it would be nice to know how to correct this.

[ Reply to This | # ]
Scripts from Sal at Apple...
Authored by: eksimo on Jan 16, '04 07:34:33AM
this should work:

on error error_message
  display dialog error_message buttons {"Cancel"} default button 1
end try
although i would add some more feedback in the dialog, like

on error error_message
  beep
  display dialog "error showing flagged mails only: " & return & return & ¬
    error_message buttons {"OK"} default button 1
end try


[ Reply to This | # ]
Scripts from Sal at Apple...
Authored by: ether on Jan 20, '04 04:41:02PM
combining Sal's hint, the diagnosis of the single-message bug, and the original hint, produces the following, which seems to work with one or more unread messages, and preserve the speedup of Sal's hint. The obvious parallel changes work for the 'flagged' case.

try
	tell application "Mail"
		activate
		tell the front message viewer
			set unReadMsgs to every message whose read status is false
			set properties to {visible messages:unReadMsgs}
		end tell
	end tell
on error error_message
	beep
	display dialog "No unread messages: " & return & return & error_message buttons {"OK"} default button 1
end try


[ Reply to This | # ]