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)

Posted on Oct 11, 2016 4:31 PM

Reply
5 replies

Apr 17, 2017 5:56 PM in response to andyfromroseville

i just ran into this problem with a script that has been working for over six years, until i "upgraded" to 10.12:-\ and it is a problem: the file isn't attached:-\


i pass in a file from a choose file dialog:


tell content of theMessage to ¬

make new attachment with properties ¬

{file name:(get tvpiFile)} at after last paragraph


and the script editor messages show:


make new attachment with properties {file name:alias "tomsTb:Users:tomw:Desktop:program.tvpi"} at after last paragraph of content of outgoing message id 1

--> missing value

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Applescript missing value

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.