Created
February 15, 2021 14:08
-
-
Save tempelmann/e7083215ca69ea5d64ae91a7da85f296 to your computer and use it in GitHub Desktop.
Create a sample email with attachment in 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
| tell application "Mail" | |
| set newMessage to make new outgoing message with properties {subject:"theSubject", content:"theBody"} | |
| set theFile to (POSIX file "/etc/hosts") as alias | |
| tell newMessage | |
| make new attachment with properties {file name:theFile} at after the last word of the last paragraph | |
| end tell | |
| end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment