Re: Setting signatures in Mail in El Capitan and Sierra
Re: Setting signatures in Mail in El Capitan and Sierra
- Subject: Re: Setting signatures in Mail in El Capitan and Sierra
- From: Hermann BRILLANT <email@hidden>
- Date: Mon, 05 Mar 2018 07:55:17 +0000
Hi
Signatures are a mess since sierra with AppleScript, it’s broken.
Here is what I use, “ the_signature” being the title of the signature in the
menu and “ the_subject” the title of the email (in case I have multiple in
edition):
-- https://discussions.apple.com/message/31159615#31159615
-- workaround for bug to handle signature since sierra,
on add_signature(the_signature, the_subject)
tell application "Mail" to activate
tell application "System Events"
tell process "Mail"
activate
click pop up button "Signature:" of window the_subject
delay 0.2
keystroke the_signature --put here the first letter of
the name of your signature
delay 0.2
keystroke return
end tell
end tell
end add_signature
Created by Hermann Brillant, Lazyware.
Enjoy ;)
> On 5 Mar 2018, at 06:24, Christian Boyce <email@hidden> wrote:
>
> Howdy. I'm trying to automate Mail. It's easy for me to create a message with
> a subject, a body, a sender, and a recipient, but I can't figure out how to
> assign a signature. It was easier in previous systems (such as 10.7.5).
>
> Here is what I have so far:
>
> use AppleScript version "2.4" -- Yosemite (10.10) or later
> use scripting additions
> set theDate to current date
> set theTime to time string of theDate
>
> tell application "Mail"
> set the_sender to "email@hidden <mailto:email@hidden>"
> set the_subject to theTime
> set the_body to "body goes here"
> set the_recipient to "email@hidden
> <mailto:email@hidden>"
> --set the_signature to signature "Christian Boyce"
> --
> set theMessage to (make new outgoing message with properties
> {subject:the_subject, content:the_body})
> --
> tell theMessage
> set visible to true
> make new to recipient at end of to recipients with properties
> {name:the_recipient}
> --set my signature to the_signature
> end tell
> end tell
>
>
> This works great to make an email but I can't automate the signature. If I
> uncomment the two lines that refer to the_signature, the script won't run. I
> do have a signature called "Christian Boyce." This script was running on an
> older Mac with 10.7.5 on it and it worked there. Today I replaced that
> machine with one running 10.11.6 and the script no longer works. Any
> suggestions? Thank you in advance.
>
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> AppleScript-Users mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
> Archives: http://lists.apple.com/archives/applescript-users
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden