Created
July 8, 2016 23:40
-
-
Save brwillis/f6aebad3c4904102d4b844a278315e09 to your computer and use it in GitHub Desktop.
Some applescript to move messages from an Outlook inbox to a dated folder in your On My Computer folder.
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
| tell application "Microsoft Outlook" | |
| activate | |
| set folderName to "Inbox" | |
| if name of selected folder is not equal to folderName then set selected folder to inbox | |
| set selectedMessages to messages of selected folder | |
| repeat with theMessages in selectedMessages | |
| set {year:y, month:m, day:d} to time received of theMessages | |
| set datedFolder to "" & y & "-" & m & "" | |
| if not (exists mail folder datedFolder of on my computer) then | |
| make new mail folder with properties {name:datedFolder} at on my computer | |
| end if | |
| set destFolder to mail folder datedFolder of on my computer | |
| move theMessages to destFolder | |
| end repeat | |
| end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment