At the request of MacSparky, I've put together a few AppleScirpts for Mac Mail users, to mark messages as unread...
Script 1: Mail • Mark All Inbox Messages Read
tell application "Mail"
set read status of every message of inbox to true
end tell
Script 2: Mail • Mark All Messages Read
display alert "Please note!" message "This script may take a while if you have a ton of mailboxes. Do you want to continue?" buttons {"Cancel", "Yes"} cancel button "Cancel"
with timeout of 600 seconds
tell application "Mail"
set read status of every message of inbox where its read status = false to true
set read status of every message of every ¬
mailbox where its read status = false to true
set read status of every message of every mailbox ¬
of every account where its read status = false to true
end tell
end timeout
Script 3: Mail • Mark Selected Mailbox Messages Read
display alert "Please note!" message "This script may take a while if you have a lot of mailboxes selected. Do you want to continue?" buttons {"Cancel", "Yes"} cancel button "Cancel"
set processSubMailboxes to (button returned of (display alert "Would you like to scan all submailboxes too?" message "Again, if you have a lot of selected mailboxes and submailboxes, this may take a while." buttons {"Yes", "No"})) = "Yes"
tell application "Mail"
tell front message viewer
set theSelectedMailboxes to selected mailboxes
repeat with a from 1 to length of theSelectedMailboxes
set theCurrentMailbox to item a of theSelectedMailboxes
processMailbox(theCurrentMailbox, processSubMailboxes) of me
end repeat
end tell
end tellon processMailbox(theMailbox, processSubMailboxes)
tell application "Mail"
if processSubMailboxes = true then
set theSubMailboxes to every mailbox of theMailbox
repeat with a from 1 to length of theSubMailboxes
set theCurrentSubMailbox to item a of theSubMailboxes
processMailbox(theCurrentSubMailbox, processSubMailboxes) of me
end repeat
end if
set read status of every message of theMailbox to true
end tell
end processMailbox
Usage
You can download these scripts here.
You can quickly and easily run them from the system-wide AppleScript menu. This menu is not enabled by default. To enable it and install the scripts...
- Launch AppleScript Editor in /Applications/Utilities
- Select AppleScript Editor > Preferences from the menu bar
- Under General, click the Show Script Menu in the Menu Bar checkbox
- Bring Mail to the front
- From the script menu, choose Open Scripts Folder > Open Mail Scripts Folder
- Copy the scripts into the folder. They will now be available from the script menu when you're working in Mail
Enjoy!
-Ben








Peachpit has bundled a new series of my
I recently spoke with
With Lion, Apple has unleashed the most innovative version of Mac OS X yet—and once again, David Pogue brings his humor and expertise to the #1 bestselling Mac book. Mac OS X 10.7 completely transforms the Mac user interface with multi-touch gestures borrowed from the iPhone and iPad, and includes more than 250 brand-new features. This book reveals them all with a wealth of insight and detail--and even does a deep dive into iCloud, Apple's wireless, free syncing service for Macs, PCs, iPhones, and iPads.
David Pogue is the personal-technology columnist for the New York Times. Each week, he contributes a print column, an online column and an online video. His daily blog, "Pogue's Posts," is the Times's most popular blog. David is also an Emmy award-winning tech correspondent for CBS News and a frequent guest on NPR's "Morning Edition." His trademark comic tech videos appear each Thursday morning on CNBC. With over 3 million books in print, David is one of the world's bestselling how-to authors. He launched his own series of complete, funny computer books called the Missing Manual series, which now includes 60 titles. David graduated summa cum laude from Yale in 1985, with distinction in Music, and he spent ten years conducting and arranging Broadway musicals in New York. He's been profiled on both "48 Hours" and "60 Minutes."
Ben Waldie is president of Automated Workflows, LLC, a company offering AppleScript, Automator, and workflow consulting services to Mac-based businesses. For years, Ben has developed professional automated solutions for companies such as Abercrombie & Fitch, Adobe Systems, Apple Inc., CNN, Microsoft, NASA, PC World, and Time Magazine. Ben is the author of “Automator for Mac OS X: Visual QuickStart Guide" (Peachpit Press) and “AppleScripting the Finder" (Automated Workflows, LLC), has written content for Apple.com, Macworld, MacTech, MacScripter.net, and more, and is the host of the “Mac Automation Made Simple" video podcast series (Peachpit Press). Ben is also the author of an AppleScript training CD for the Virtual Training Company, and is a frequent presenter at Macworld and other industry events.


