Skip to content

Instantly share code, notes, and snippets.

@tylerpeterson
tylerpeterson / New Draft in Outlook.AppleScript
Created September 21, 2015 21:18
Making a new email in Outlook 365 via AppleScript
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