Created
March 26, 2015 17:51
-
-
Save adrianpike/2a7ed077a03406427a4f to your computer and use it in GitHub Desktop.
Outlook Archived
This file contains hidden or 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
-- Put this into your Outlook scripts folder (~/Library/Application Support/Microsoft/Office/Outlook Script Menu Items/) | |
on run {} | |
tell application "Microsoft Outlook" | |
set msgs to current messages | |
if ((count of msgs) < 1) then return | |
set mailFolders to mail folders | |
repeat with fld in mailFolders | |
if (name of fld is "Archived") then | |
set target to fld | |
-- TODO: break? I have no clue how to applescript | |
end if | |
end repeat | |
try | |
target | |
on error | |
display dialog "You need to create a folder named Archived." | |
return | |
end try | |
repeat with msg in msgs | |
if (class of account of msg is not imap account) then | |
-- IMAP currently not supported | |
move msg to target | |
end if | |
end repeat | |
end tell | |
end run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment