Skip to content

Instantly share code, notes, and snippets.

@nbugrov
Created June 15, 2018 09:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nbugrov/59ff6803bb32f72d441b5a6b6106d60f to your computer and use it in GitHub Desktop.
Save nbugrov/59ff6803bb32f72d441b5a6b6106d60f to your computer and use it in GitHub Desktop.
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