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

Mark all as read in Mail via AppleScript Apps
I've always been annoyed that the only way to mark all as read for a mailbox in Mail was with a contextual menu in the sidebar. So I wrote a simple AppleScript to do the job:
tell application "Mail"
  activate
  get message viewer 1's selected mailboxes
  repeat with thisBox in result
    set read status of (messages of thisBox whose read status is false) to true
  end repeat
end tell
I use Butler (but any such tool capable of creating macros would work) as my quick launch keyboard macro tool, and I've assigned the above script to run when I press Command-K (to match my NetNewsWire usage).
    •    
  • Currently 1.90 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (10 votes cast)
 
[12,514 views]  

Mark all as read in Mail via AppleScript | 6 comments | Create New Account
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: MacTipper on Oct 05, '09 09:26:10AM
You can accomplish the same thing by hitting Cmd-A then hitting Cmd-Shift-U. (Message menu > Mark > As Read/Unread)

MacTipper
http://mactipper.com/

[ Reply to This | # ]
Mark all as read in Mail via AppleScript
Authored by: jwahkan on Oct 06, '09 05:03:23AM

You can also do this by creating a keyboard shortcut for the contextual menu item.



[ Reply to This | # ]
Mark all as read in Mail via AppleScript
Authored by: alset on Oct 06, '09 02:51:40PM

Brilliant! I didn't realize OS X would recognize contextual menus for shortcuts. Two points for you.

---
standing on the shoulders of giants



[ Reply to This | # ]
Mark all as read in Mail via AppleScript
Authored by: Dominus on Dec 08, '09 08:24:36AM

I cannot assign a shortcut for the contextual menu in the sidebar. "mark all messages read" (or something like that, in my German OS X it is called "Alle Nachrichten als gelesen markieren") which is availlable when right clicking on a folder/account in the Mail sidebar does not seem to be assignable...



[ Reply to This | # ]
Mark all as read in Mail via AppleScript
Authored by: vniks on Oct 07, '09 12:59:11PM

I have 3 emails on mine. How do I check all the emails as read?? This script is really helpful. Thanks



[ Reply to This | # ]
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 | # ]