Created
September 21, 2015 21:18
-
-
Save tylerpeterson/c3aa65806bf141b04e25 to your computer and use it in GitHub Desktop.
Making a new email in Outlook 365 via AppleScript
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
set the_file_name to "test.txt" | |
set the_file to alias ((path to desktop as text) & the_file_name) | |
tell application "Microsoft Outlook" | |
set new_message to make new outgoing message at mail folder "Cabinet" with properties ¬ | |
{subject:"Test Subject", content:"Here is some test content. See attached: " & the_file_name} | |
make new attachment at end of new_message with properties {file:the_file} | |
make new recipient at new_message with properties {type:to recipient type, email address:{name:"Tyler Peterson", address:"[email protected]"}} | |
make new recipient at beginning of new_message with properties {type:cc recipient type, email address:{name:"CC Tyler", address:"[email protected]"}} | |
make new recipient at beginning of new_message with properties {type:bcc recipient type, email address:{name:"BCC Tyler", address:"[email protected]"}} | |
end tell | |
👍
Is possible to set HTML content?
Great idea - but I can't get this to work. When I change Cabinet to Drafts, it runs - but nothing seems to happen?
Same here. it runs, but nothing happens (
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Good one, thanks!