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


Click here to return to the 'Mark all as read in Mail via AppleScript' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Mark all as read in Mail via AppleScript
Authored by: embraboy on Apr 25, '10 11:01:05AM

I was having a fanny around in applescript and came up with this:

tell application "Mail"
activate

--repeat with s_account in (get every account of application "Mail")

repeat with s_mailbox in (get mailbox of account "your account")

if the name of s_mailbox is not "INBOX" then

repeat with unreadmail in (every message in s_mailbox whose read status is false)

set read status of unreadmail to true

end repeat

end if

end repeat

--end repeat

end tell

I added it as a rule to run whenever mail is received and it seems to do the trick nicely. The commented out lines are useful if you have multiple accounts that need cleaned up.

Happy to get any feedback on this as it's my first foray into applescript - and scripting generally. If there's anything I could do to tidy it up I'd be happy to hear about it.

Cheers!



[ Reply to This | # ]