I have a lot of accounts in Mail. I use KeyboardMaestro to automate much of what I do, but I haven't found a way to reliably get it to choose a given account in a new message window. I'm wondering if I can get applescript to do it for me.
I have the following:
tell application "Mail" to make new outgoing message with properties {sender:"my@email.address"}
and Mail obediently opens a new message window…but doesn't bother to set the sender correctly 🙁
I've also tried using the entire string which appears in the Sender popup menu in the window (which seems to be the Alias, in the Accounts pane of Mail's prefs window), plus just the substring before the hyphen (which seems to be the Full Name in Mail's prefs). Nothing works.
Has anyone managed to get this to work?
Best Answer
From here
Slightly different format for the
sender
property.So yours would be...
You can find and edit the
FirstN
andLastN
in System Preferences>Internet Accounts>[Email Name]>Details>Name