Friday, July 21, 2017

#1 2017-06-22 01:43:25 pm

JanGeerling
Member
Registered: 2005-01-18
Posts: 57

Mail Script - Signature

I'm trying to set a signature in my outgoing mail message, but it's not working :

Applescript:


tell application "Mail"
   set nieuwBERICHT to make new outgoing message with properties {visible:true, sender:"Jan Geerling<jan@str8.nl>", subject:"TEST"}
   delay 2
   tell nieuwBERICHT to set message signature to "JAN-NL"
   delay 2
   tell nieuwBERICHT to make new attachment with properties {file name:orderbevestigingPDF} at after last paragraph
end tell

And this script only give 'missing value'

Applescript:


tell application "Mail"
   set everySignature to the name of every signature
end tell

Is that a bug ?

Offline

 

#2 2017-06-23 02:56:42 am

DJ Bazzie Wazzie
Member
From:: the Netherlands
Registered: 2004-10-20
Posts: 2665
Website

Re: Mail Script - Signature

JanGeerling wrote:

Is that a bug ?


I can confirm that in Sierra it doesn't work but it does work in El Capitan. Somehow signature is broken in Mail version 10. The dictionary still says signature is an application class so the code is correct. I think you're right and you've found a bug in mail.

Offline

 

#3 2017-07-03 05:10:24 am

weedinner
Member
From:: London
Registered: 2005-08-15
Posts: 241
Website

Re: Mail Script - Signature

Hi

This handler works

Applescript:


emailattachments("zzzzzz@me.com", "xxxx", "xxxxx")
on emailattachments(theAddress, theSubject, theBody)
   
   tell application "Mail"
       set theSignature to signature "New Signature"
       set newMessage to make new outgoing message with properties {subject:theSubject, content:theBody}
       tell newMessage
           set visible to true
           
           make new to recipient at end of to recipients with properties {address:theAddress}
           
           set message signature to theSignature
       end tell
       
       --send newMessage
   end tell
   
end emailattachments

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)