Skip to content

Instantly share code, notes, and snippets.

@adrianpike
Created March 26, 2015 17:51
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adrianpike/2a7ed077a03406427a4f to your computer and use it in GitHub Desktop.
Save adrianpike/2a7ed077a03406427a4f to your computer and use it in GitHub Desktop.
Outlook Archived
-- 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