Selecting Mail signature using Applescript

I am trying to use selected signatures in Mail High Sierra but after numerous attempts cannot find the correct syntax, the latest error states "Mail got an error: Can’t make {sender:\"somebody@gmail.com\", subject:\"Test signature\", content:\"Not working\", selected signature:\"Signature #1\"} into type properties of outgoing message." number -1700"

Any help would be very gratefully received!


tell application "Mail"

activate

set newEmail to make new outgoing message with properties {sender:"somebody@gmail.com", subject:"Test signature", content:"Not working", selected signature:"Signature #1"}

tell newEmail

make new to recipient with properties {address:"someoneelse@gmail..com"}

end tell

end tell

iMac (27-inch, Late 2012), macOS Sierra (10.12.6)

Posted on Dec 13, 2017 6:13 AM

Reply
Question marked as Top-ranking reply

Posted on Dec 13, 2017 8:36 AM

The Mail scripting dictionary shows a property message signature, not selected signature, for outgoing message. This is true in El Capitan and High Sierra scripting dictionaries for Mail.

4 replies

Dec 14, 2017 2:06 AM in response to VikingOSX

Thanks for reply, changed 'selected signature' to 'message signature' but now have error "error "Mail got an error: Can’t make class outgoing message." number -2710 from outgoing message to class" and have no idea what that means. Tried searching the web and found another discussion in Apple Discussions with the same signature problems, it would appear that this is a known bug which Apple is unlikely to fix anytime soon because AppleScript is no longer of any interest to them, sad.

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.

Selecting Mail signature using Applescript

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