On 3/21/01 2:37 PM, "Allen Watson" <[EMAIL PROTECTED]> wrote:
> Sometimes I receive an HTML message that I want to forward to a friend.
> <Rarely>, but sometimes! I just received a newsletter today that has a good
> article about avoiding injury from prolonged and repeated use of a computer,
> which a lot of us do. I wanted to forward this message to a friend. When I
> forwarded it, however, Entourage turned it into plain text, with lots of
> blank lines and strange formatting and, of course, no graphics.
>
> I tried writing a script using "forward theMsg with HTML text". This
> produced results identical to the plain forward, except that the text was in
> HTML format, using my default font and size, but otherwise the same as the
> plain text version. No graphics, no styling of the text.
>
> Personally, I can live without being able to compose complex HTML messages
> in my mail. I have never had the need. However, having received such a
> message, I think it <should> be possible to retransmit the identical message
> without editing. [Pause while I smack my forehead] Hey! That's a clue:
> "retransmit...without editing." Sounds like "redirect." I wonder...
>
> Yes!! When I redirect the incoming HTML message, it appears as an outgoing
> message with all the HTML formatting and graphics intact. I just learned
> something.
Here's how to retransmit HTML via applescript, when you want to change
something in the email. The problem is that:
1) Redirect won't let you change anything at all, not even in applescript.
2) Changing anything by getting the various properties of the original and
trying to re-use the 'content' of the original message converts it into
unstyled text and loses the HTML, as you discovered.
I figured out how to do it:
Set a variable to the source of the original message. That will include the
HTML code. (If you need to parse the headers, do it within the source
variable, not a separate headers variable.) Make a new message whose
properties are set to what you want (different recipients, etc.) and whose
source property is set to the variable you saved. Voilà!
It's a lot trickier if you want to do this for a draft message, but still
possible. Check the latest version of Separate Group Messages 1.2. (You have
to save the draft window, then make a new message using the source of the
message so formed, then delete the original eventually.)
[OT]:
A very interesting sidelight came up when I was working on that script.
Although you can set any property which normally displays in the source to
something different right at the moment of creation (i.e. make new outgoing
message with properties {source:theSource, attachment:someOtherAttachment}),
the one thing you can't do that with is time sent. And whereas getting
'headers' of the message would, you'd think, get you the same thing as the
headers as displayed in the source, in the case of a saved unsent draft
message, it doesn't! 'headers' gets you exactly the headers as you see them
in the unsent draft, including Date as 'time sent', which for a draft
message is actually the time it was last saved (since it hasn't been sent
yet). But getting 'source' of that unsent draft message shows Date, like
'time sent', to be the current time! I guess that's how it gets updated to
the real time sent when the message finally gets sent. That's why you have
to parse the source itself if you want to fit changes back into it. Not
something most people would want to do, of course, but I had to do it for
that script to replace the multiple recipients in the original source with
the individual recipients of each separated message.
--
Paul Berkowitz
--
To unsubscribe: <mailto:[EMAIL PROTECTED]>
To search the archives:
<http://www.mail-archive.com/entourage-talk%40lists.boingo.com/>