So it’s pretty apparent now that Tiger Mail.app has a serious flaw in that we can no longer set the content of signatures and existing messages. Bleck! So I’ve been trying to work-around this inconvenience by writing a script the makes a new outgoing message with my own custom signature already inserted into the content. The following code concatenates the content of a template signature and a random quote signature into the content of a new outgoing message:
set new_msg to make new outgoing message with properties ¬
{sender:for_acct, content:return & ((content of signature sig_name as Unicode text) ¬
& content of rand_sig as Unicode text), visible:true}
Works great, except that the signature content loses all of its style formatting in the process. I’ve also tried using “as styled text” in place of “as Unicode text,” but with the same result: nada.
I know that we can get/set individual headers, and so I was thinking that maybe I can set the Content-Type to “text/HTML” and that might preserve the sig content formatting. The problem now is that I can’t figure out the correct syntax for setting just the Content-Type header within the context of the make new outgoing message command.
The message headers appear to be stored in a nested structure similar to this:
{headers:¬
{header_1:¬
{name:"mime-version", content:"1.0 (Apple Message framework v750)"},¬
header_2:¬
{name:"content-type", content:"text/html; charset=ISO-8859-1"}¬
}¬
}
Make new outgoing message chokes on almost every way I’ve tried to access a nested individual header within the headers structure. The only form that didn’t throw an error was when I attempted this:
set new_msg to make new outgoing message with properties ¬
{sender:for_acct, header:{name:"content-type", content:"text/html; charset=ISO-8859-1"}, ¬
content:return & ((content of signature sig_name as Unicode text) ¬
& content of rand_sig as Unicode text), visible:true}
But that had absolutely no effect on the content-type header of the resulting message. At this point I’m stumped. Any ideas? Thanks in advance.
Model: 12" PowerBook G4
AppleScript: 1.10.6
Browser: Safari 417.9.2
Operating System: Mac OS X (10.4)