0

I have a little automator script that creates an email.

This works. I would however like to add a specific signature to the email.

The signature is called "Default Sig".

I tried this, but it doesn't work. How can I implement this?

Thanks - Joseph enter image description here

6
  • 1
    Why down vote this question? I was not able to find a similar one... And Google searching did not yield any results either. – Joseph Jul 1 '18 at 6:50
  • Check input in your AppleScript to ensure it is a single message and not a list of messages – or maybe some other type entirely? Does the AppleScript work from Script Editor when passed a message? – Graham Miln Jul 1 '18 at 11:25
  • Is the Default Sig set in Mail app? You can always use a Ask Text action with a default value. – user14492 Jul 1 '18 at 11:57
  • @user14492 The signature I want to use is named exactly like that "Default Sig". – Joseph Jul 1 '18 at 13:58
  • @GrahamMiln I am not sure how I can test that? can I add breakpoints? These are the only two actions in the little "app". Nothing gets dragged onto the app, so there shouldn't be any other inputs. – Joseph Jul 1 '18 at 13:59
2

AppleScript

You can set the signature yourself with AppleScript:

tell application "Mail"
    
    set myMessage to make outgoing message
    set subject of myMessage to "this is the subject"
    set content of myMessage to "this is the content."
    
    set message signature of myMessage to (signature named "Default Sig")
    
end tell

See AppleScript/Automate Mail Tasks for sample AppleScripts to create, combine, and send messages.

Graphic User Interface (GUI) Scripting

While less reliable, you could try scripting the GUI to select the signature.

7
  • That it is not part of the framework fits to the observation, that the new message pops up before it goes to the Run AppleScript step. Is there a way for me to toggle the dropdownfield as a second step? – Joseph Jul 1 '18 at 14:46
  • 1
    Thanks for your effort with my question! Have a good day! – Joseph Jul 1 '18 at 14:51
  • Strangely enough, there is a property called message signature (yes with a space) that you can read with code like set messageSignature to the message signature of newMessage - but I have not been able to figure out how to set it. set the message signature of newMessage to messageSignature throws an error -10000 AppleEvent handler failed – Floris Sep 12 '20 at 2:49
  • @GrahamMiln that.is.awesome! How did you know to use “signature named”? – Floris Sep 12 '20 at 11:28
  • 1
    @GrahamMiln - I was running on 10.14 and getting errors. I then tried it on 10.15 and it works. It seems that this must have been a feature that was added/fixed in Catalina. – Floris Sep 14 '20 at 14:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .