I am attempting to send an email via the standard Apple Mail application using a POSIX file reference on macOS Sierra (10.12.3). Everything builds fine, but when it sends, the attachment is not being received.
Here's the code:
set fileReference to (choose file with prompt "Select file for attachment...")
tell application "Mail"
make new attachment with properties {file name:fileReference}
The recipient is set earlier in the code, and there are no issues with sending the email itself: just the attachment.
Any help or insight would be greatly appreciated.
Best Answer
Open Script Editor, create a new document, and add the AppleScript Code, shown below, to it.
In the
make new to recipient ...
line of code, change the values of{name:"John Doe", address:"johndoe@domain.com"}
to your name and email address for testing purposes.Now run the script.
AppleScript Code: