Created
June 15, 2018 09:53
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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