Last active
September 5, 2019 02:04
-
-
Save CatChen/fe07ab39c7ea27d296e57838d7b5f1a4 to your computer and use it in GitHub Desktop.
This file contains 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 theRecipients to {{name:"Cat Chen", email:"catchen@catchen.me"}, {name:"Roli Chen", email:"roli@chen.cat"}, {name:"Elle Chen", email:"elle@chen.cat"}} | |
set theAttachment to (choose file with prompt "Select file for attachment...") | |
tell application "Mail" | |
repeat with theRecipient in theRecipients | |
set theMessage to make new outgoing message with properties {visible:true, subject:"Email with File Attachment", content:"Hi " & name of theRecipient & "," & linefeed & linefeed & "Check out the attachment in this email!" & linefeed & linefeed} | |
tell theMessage | |
make new to recipient at end of to recipients with properties {name:name of theRecipient, address:email of theRecipient} | |
make new attachment at end of last character of content with properties ¬ | |
{file name:theAttachment} | |
end tell | |
delay 1 | |
send theMessage | |
end repeat | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment