From: Bill Bryson <
[email protected]>
Newsgroups: microsoft.public.mac.office.entourage
Date: Tue, 30 May 2006 09:43:29 -0500
Conversation: Script to view mal-formed HTML messages related to Exchange bug
Subject: Re: Script to view mal-formed HTML messages related to Exchange bug
Paul,
The message is retuned blank when executing the first script lines you sent.
It seems that a script would have to be able to perform the following
actions:
1) Capture the text of the "View Source" window of the selected message
2) Parse the HTML code to retrieve the actual text of the message
3) Replace all <BR> with carriage return
4) Form a new message window with just that text and display it.
Here is an example of the mal-formed HTML source:
Message contents:
[Standard Internet headers appear first]
<HTML dir=3Dltr><HEAD><TITLE>test again</TITLE>=0A=
<META http-equiv=3DContent-Type content=3D"text/html;
charset=3Dunicode">=0A=
<META content=3D"MSHTML 6.00.2900.2873" name=3DGENERATOR><BASE =
href=3DHEAD>=0A=
<BODY>=0A=
<DIV id=3DidOWAReplyText89771 dir=3Dltr>=0A=
<DIV dir=3Dltr><FONT face=3DArial color=3D#000000 size=3D2>reply =
back</FONT></DIV></DIV>=0A=
<DIV dir=3Dltr><BR>=0A=
<HR tabIndex=3D-1>=0A=
<FONT face=3DTahoma size=3D2><B>From:</B> Bryson, Bill<BR><B>Sent:</B> =
Tue 5/23/2006 8:48 AM<BR><B>To:</B> Bryson, William D<BR><B>Subject:</B> =
test again<BR></FONT><BR></DIV>=0A=
<DIV>=0A=
<P><FONT size=3D2>test of OWA Prem.<BR>--<BR>Bill Bryson<BR>Computing =
Support Services<BR>Texas State University-San =
Marcos<BR><BR><BR><BR></FONT></P></DIV></BODY></HTML>
What the user would rather see is:
From: Bryson, Bill
Sent: Tue 5/23/2006 8:48 AM
To: Bryson, William D
Subject: test again
test of OWA Prem.
-
Bill Bryson
Computing Support Services
Texas State University-San Marcos
First try the really simple way, which should get you just the plain text
part alternative part of the source.
Select the message and run this in Script Editor:
tell app "Microsoft Entourage"
set theMsg to item 1 of (get current messages)
return (content of theMsg)
end tell
Check the Result pane in Script Editor. If this works, than the simplest
thing would be just to replace the blank message with plain text. You could
save this script and run it from the script menu on any such message:
tell app "Microsoft Entourage"
set theMsg to item 1 of (get current messages)
set content of theMsg to (content of theMsg)
end tell
(If you really need the HTML then, yes, a script could get the source, parse
it, add the </HTML> tag if you can specify _exactly_ after which other tag
it should go, and make a new replacement message with the corrected source.
If you can give me that info then, yes, it can be done.)