Applescript missing value
I have an applescript that creates and sends an email with an attachment.
The applescript does what it needs to do and the recipients get the email with the attachment with no problem.
When I run the applescript there is a “missing value” logged when the “make new attachment” is executed.
My question is why the “missing value”. I checked the Applescript dictionary for Mail and didn’t see anything I needed to add.
Has anyone any ideas please …. below are the contents of the applescript and the log when it runs.
tell application "Mail"
set msg to makenewoutgoing messagewith properties {subject:theSubject, visible:true}
tell msg
makenewto recipientwith properties {name:theName, address:theAddress}
makenewattachmentwith properties {file name:aliastheAttachmentFile}
delay 1
send
end tell
end tell
tell application "Mail"
makenewoutgoing messagewith properties {subject:"MediaBU log", visible:true}
--> outgoing messageid 2
makenewto recipientwith properties {name:”My Name”, address:”myname@anemail.com"}
--> to recipient 1 of outgoing messageid 2
makenewattachmentwith properties {file name:alias "El Capitan HD:Users:Me:Documents:MediaBU:MediaBU.log" of outgoing messageid 2}
--> missing value
sendoutgoing messageid 2
--> true
end tell
MacBook Pro (Retina, 15-inch, Mid 2015), OS X El Capitan (10.11.6)