AppleScript Mail: Can't make file into type alias

Some advice please. I'm stumped as to why I keep getting "Can't make file into type alias".

I get this both on my latest M1 desktop and older MacBook (El Capitan). Having looked around I believe I have the appropriate script. Thanks in advance.



on run

set PDFpath to (path to desktop as text) & "Bobbycopy.pdf"

tell application "Mail"


set theSubject to "Scores"

set theContent to "something here"

set theAddress to "email address"

set theAttachmentFile to PDFpath


set msg to make new outgoing message with properties {subject:theSubject, content:theContent, visible:true}


tell msg to make new to recipient at end of every to recipient with properties {address:theAddress}


tell msg to make new attachment with properties {file name:theAttachmentFile as alias}


end tell

end run

Posted on Nov 24, 2022 7:54 AM

Reply

Similar questions

2 replies

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 Mail: Can't make file into type alias

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