Thursday, July 4, 2024

applescript – Mac Mail – Set signature by sending tackle

I take advantage of macOS’s Mail app and have iCloud+. I’ve two mail addresses – my normal iCloud tackle and one other via a customized area that I personal, that maps again to the iCloud account (one thing which is simply doable with iCloud+ )

Incoming mail for each addresses seem in my iCloud inbox. No actual drawback. When composing outgoing mail I can choose the sending tackle from the drop down within the “From” subject. Additionally no drawback.

I’ve arrange two mail signatures, one supposed for mail despatched from the iCloud tackle, the opposite for mail despatched from the customized tackle. When composing, each signatures can be found from the “Signature” drop down. All good.

I need to have Mail choose the right signature in response to the “From” tackle. If I modify the chosen “From” tackle, the chosen signature must also change. Is that this doable?

The problem appears to be that the configuration of Mail, iCloud+ and the customized area ends in Mail considering that there’s just one account (in Mail/Settings/Accounts ) which is the iCloud one. My two signatures are each related to that one account, though they’re supposed totally different for sending addresses. Mail sees that the sending account is iCloud and appears unable to pick a signature by sending tackle.

Is there a approach round this utilizing AppleScript or different instrument?

In Mail/Settings/Guidelines I’ve made the rule:

If From is the same as [email protected] , Run this applescript

inform software “Mail”
set theMsg to (get first outgoing message)
set message signature of theMsg to signature “albert”
finish inform

and I’ve a signature known as albert, and one other rule and script that ought to do the identical for the customized tackle.

The script itself works, however Mail’s guidelines appear to be solely work on incoming mail and never outgoing.

Consequence: Neither of the principles and the scripts get triggered.

Is there a strategy to get mail to run a script on altering the sending tackle? Or different strategy to set the signature by sending tackle?

Mac OS 13.2.1 , Mail 16.0

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles