Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Applescript to mark all unread email as read (including subfolders) starting from the currently selected folder in Microsoft Outlook
tell application "Microsoft Outlook" to activate
tell application "Microsoft Outlook"
set currentFolder to selected folder
my mark_subfolders_read(currentFolder)
set selected folder to currentFolder
end tell
on mark_subfolders_read(targetFolder)
tell application "Microsoft Outlook"
if targetFolder's unread count is not 0 then
set selected folder to targetFolder
my mark_all_read()
end if
set targetSubfolders to (every mail folder of targetFolder)
repeat with aFolder in targetSubfolders
my mark_subfolders_read(aFolder)
end repeat
end tell
end mark_subfolders_read
on mark_all_read()
tell application "System Events" to tell process "Microsoft Outlook"
tell menu bar 1
click menu item "Mark All as Read" of menu "Message"
end tell
end tell
end mark_all_read
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.