Mark Mailbox Read

Summary: Marks every message in a mailbox as read (seen).
Requires: Mailsmith
Suggested Key Binding: Command-Option-M
Last Modified: 2019-10-02

Description

Select a mailbox and run the script. It will act on every message in the selected mailbox, as well as on messages in submailboxes.

Installation Instructions · Download in Compiled Format · Download in Text Format

Script

on run
    
tell application "Mailsmith"
        
set mBoxList to get selection as list
        
repeat with mbox in mBoxList
            
my markRead(mbox)
        
end repeat
    
end tell
end run

on markRead(mbox)
    
tell application "Mailsmith"
        
set unreadMail to (every message of mbox whose seen is false)
        
repeat with m in unreadMail
            
set seen of m to true
        
end repeat
        
        
set ct to count mailboxes of mbox
        
if ct is 0 then return
        
repeat with i from 1 to ct
            
set m to mailbox i of mbox
            
my markRead(m)
        
end repeat
    
end tell
end markRead