Re: Saving HTML from Entourage
Re: Saving HTML from Entourage
- Subject: Re: Saving HTML from Entourage
- From: Paul Berkowitz <email@hidden>
- Date: Fri, 28 May 2004 08:52:33 -0700
On 5/28/04 7:18 AM, I wrote:
>
It sure would be easier to save as an .eml which opens in Entourage, yes.
Ah, WTH. Here's how to make an HTML file that will open in Safari (or change
it to IE or whatever). You do have to set a browser's creator type or it
opens in TextEdit without linked pictures, etc.
tell application "Microsoft Entourage"
set theMsg to item 1 of (get current messages)
set {theSubject, theSource, theContent, hasHTML} to {subject, source,
content, has html} of theMsg
end tell
if hasHTML then
set AppleScript's text item delimiters to {"<HTML>"}
try
set theText to text item 2 of theSource
set theCase to "UPPER"
on error
set AppleScript's text item delimiters to {"<html>"}
set theText to text item 2 of theSource
set theCase to "lower"
end try
if theCase is "UPPER" then
set AppleScript's text item delimiters to {"</HTML>"}
else
set AppleScript's text item delimiters to {"</html>"}
end if
set theText to text item 1 of theText
set AppleScript's text item delimiters to {""}
set filePath to (path to desktop as Unicode text) & theSubject & ".html"
--use another folder as desired
else -- plain text
set theText to theContent
set filePath to (path to desktop as Unicode text) & theSubject & ".txt"
end if
try
set f to open for access file filePath with write permission
set eof f to 0
write theText to f
close access f
on error
try
close access f
end try
end try
if hasHTML then
tell application "Finder" to set creator type of alias filePath to
"sfri" -- or MSIE, whatever
end if
--
Paul Berkowitz
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.