I tried to use this code:
tell application "Mail"
set newSignatureContent to "Content of the new signature"
set newSignatureName to "NewSignature"
-- Create the signature
set newSignature to make new signature with properties {content:newSignatureContent, name:newSignatureName}
-- Set the signature as default for all existing accounts
set allAccounts to every account
repeat with currentAccount in allAccounts
set signatures of currentAccount to {newSignature}
set **default signature** of currentAccount to newSignature
end repeat
end tell
but I get a Syntax Error. A class name cant go after this application constant or consideration and default signature is highleted, can you help me understand what is wrong here?
I tried to figure out a way to this coding the clicks on buttons but that's even more difficult and creates other problems.
Account's default (or selected) signature property doesn't exist.
Exists Mail.app's selected signature property, which when setting to NAME of some signature, makes it selected (default) for IMAP accounts (such as "Gmail" account)
So, I am on Catalina. For my iCloud account following script doesn't work, but works for my Gmail account:
NOTE: you can set selected signature to constants randomly, sequentially, or none, as well.