Resend of- 7/15 ->2004: How zoom+ view of received small-fonthtml newsletters?

  • Thread starter Norman R. Nager, Ph.D.
  • Start date
N

Norman R. Nager, Ph.D.

In Entourage Email 2004, is there any way to change the view of incoming
html newsletters so that the text font appears larger (and still retain the
ability to click on links)?

Respectfully, Norm
 
M

Mickey Stevens

Not with complex HTML, which is what I suspect you're referring to. Here's
a workaround if you're interested:

Copy this script from a message from Allen Watson:

property browser : ""

if browser = "" then
set browser to choose file of type "APPL" with prompt "Please select
your default browser."
end if
tell application "Finder" to set defBrowserName to name of browser

tell application "Microsoft Entourage"
set theMsg to item 1 of (get current messages)
try
if has html of theMsg is true then
set pts to item 1 of (get parts of theMsg)
set pts to parts of pts
repeat with i from 1 to (count pts)
set aPart to item i of pts
set theType to type of aPart
set theSubtype to subtype of aPart
if theType is "text" and theSubtype is "html" then
set theHTML to content of aPart
exit repeat
end if
end repeat
set tempfile to open for access "tempHTML2.html" with write
permission
write theHTML to tempfile
close access tempfile
set theFile to "tempHTML2.html"
else
display dialog "Selected message seems to have no HTML to open."
return
end if
on error theErr
display dialog theErr
return
end try
end tell
set theDisk to path to startup disk as string
set theFile to theDisk & theFile
-- Give the file the creator type of the default browser
tell application "Finder"
set f to alias theFile
set ct to creator type of browser
set ft to "TEXT"
set creator type of f to ct
set file type of f to ft
end tell
try
set thePath to POSIX path of theFile
set theDisk to text 1 thru -2 of theDisk -- remove delimiter
set theURL to "file://" & theDisk & thePath
tell application defBrowserName
activate
open location (theURL)
end tell
on error theErr
display dialog theErr
end try
delay 5
tell application "Finder" to delete theFile
tell application "Finder" to empty trash

Copy everything starting with "tell" and ending with "trash" and paste it
into a blank script in Script Editor (/Applications/AppleScript/Script
Editor/). Then, save it to the "Entourage Script Menu Items" folder in the
Microsoft User Data folder. I called it "Open HTML in Browser". Then, when
you're viewing a newsletter, click the Script menu (to the right of the Help
menu), and select the "Open HTML in Browser" script. You'll be prompted to
select a browser. Once you choose one, the newsletter will open in the
browser, which will allow you to increase or decrease font size (process
varies depending on browser; for Internet Explorer and Safari, the command
is in the View menu, or on the toolbar if you've customized it).
 
M

Mickey Stevens

Copy this script from a message from Allen Watson:

property browser : ""

if browser = "" then
set browser to choose file of type "APPL" with prompt "Please select your
default browser."
end if
tell application "Finder" to set defBrowserName to name of browser

tell application "Microsoft Entourage"
set theMsg to item 1 of (get current messages)
try
if has html of theMsg is true then
set pts to item 1 of (get parts of theMsg)
set pts to parts of pts
repeat with i from 1 to (count pts)
set aPart to item i of pts
set theType to type of aPart
set theSubtype to subtype of aPart
if theType is "text" and theSubtype is "html" then
set theHTML to content of aPart
exit repeat
end if
end repeat
set tempfile to open for access "tempHTML2.html" with write
permission
write theHTML to tempfile
close access tempfile
set theFile to "tempHTML2.html"
else
display dialog "Selected message seems to have no HTML to open."
return
end if
on error theErr
display dialog theErr
return
end try
end tell
set theDisk to path to startup disk as string
set theFile to theDisk & theFile
-- Give the file the creator type of the default browser
tell application "Finder"
set f to alias theFile
set ct to creator type of browser
set ft to "TEXT"
set creator type of f to ct
set file type of f to ft
end tell
try
set thePath to POSIX path of theFile
set theDisk to text 1 thru -2 of theDisk -- remove delimiter
set theURL to "file://" & theDisk & thePath
tell application defBrowserName
activate
open location (theURL)
end tell
on error theErr
display dialog theErr
end try
delay 5
tell application "Finder" to delete theFile
tell application "Finder" to empty trash

Copy everything starting with "tell" and ending with "trash"
I'm sorry, I meant to copy everything starting with "property" (basically
all of the small text).
 
N

Norman R. Nager, Ph.D.

Thanks very much, Mickey.

1. When one receives a newsletter in html format, what exactly does this
script do?

2. I've copied it into Script Editor and saved it. Is this to be stored in
the same folder with other Entourage 2004 scripts? How is it activated?

Respectfully, Norm
 
N

Norman R. Nager, Ph.D.

Ah, I just opened your OTHER message with the same title and found the
answers to my two earlier questions. I erred and thought because they were
sent minutes apart that they were identical.

"Save in "Entourage Script Menu Items" folder in the Microsoft User Data
folder. I called it "Open HTML in Browser". Then, when you're viewing a
newsletter, click the Script menu (to the right of the Help menu), and
select the "Open HTML in Browser" script. You'll be prompted to select a
browser. Once you choose one, the newsletter will open in the browser,
which will allow you to increase or decrease font size (process varies
depending on browser; for Internet Explorer and Safari, the command is in
the View menu, or on the toolbar if you've customized it)."

Mickey, a couple problems encountered with the script starting with two
dialogues that come up. There are no typos in what follows:

"The variable thehtml is not defined. Cancel__ OK_" (no space between the
and html)

"Microsoft Entourage got an File file Drive A: temp HTML2.html is already
open, Cancel__ OK_"

If you can troubleshoot those, then please suggest how to change the script
so it automatically looks for and opens Safari, rather than prompting one to
find it each time.

Thanks very much.

Respectfully, Norm
 
P

Paul Berkowitz

Ah, I just opened your OTHER message with the same title and found the answers
to my two earlier questions. I erred and thought because they were sent
minutes apart that they were identical.

"Save in "Entourage Script Menu Items" folder in the Microsoft User Data
folder. I called it "Open HTML in Browser". Then, when you're viewing a
newsletter, click the Script menu (to the right of the Help menu), and select
the "Open HTML in Browser" script. You'll be prompted to select a browser.
Once you choose one, the newsletter will open in the browser, which will allow
you to increase or decrease font size (process varies depending on browser;
for Internet Explorer and Safari, the command is in the View menu, or on the
toolbar if you've customized it)."

Mickey, a couple problems encountered with the script starting with two
dialogues that come up. There are no typos in what follows:

"The variable thehtml is not defined. Cancel__ OK_" (no space between the
and html)

From what I can see, this message seems to be HTML but doesn't have an
"html" part. That was Barry's idea - this started out as his script. I think
that there are some messages floating around that are "mhtml" and other
subtypes I'm not familiar with. There are even a few message that are only
HTML, no plain text parts, so it may be that this message doesn't have any
Parts of part 1. It's probably a message that doesn't follow all the rules.
Somebody who knows this stuff well - Barry or Allen - may know what other
sorts of error traps and fixes to add. Mickey won't know that - he was just
passing on Allen's revision of Barry's script to you. I don't know this HTML
stuff either - I just know where the script must have faltered.
"Microsoft Entourage got an File file Drive A: temp HTML2.html is already
open, Cancel__ OK_"
That's a byproduct of the other error. Since the script errored after
opening a file for access, it left it open. All try/error blocks in scripts
that open files for access should contain a

on error
try
close access "tempHTML2.html"
end try
--rest of error stuff
end tryWhoever fixes the script can fix that too.
If you can troubleshoot those, then please suggest how to change the script so
it automatically looks for and opens Safari, rather than prompting one to find
it each time.


That's another matter. Again Mickey won't know, and Allen must have
forgotten. If you're in Panther, then any scripts you save in Panther's
Script Editor will not retain properties when run from Entourage's script
menu. (It's Entourage's fault for not changing its method when the OS and
Script Editor changed. But this was the second change in a year - Jaguar's
script Editor had also made a previous change which Entourage followed. It's
a little complicated by the fact that Entourage 2004 still has to work in OS
10.2.8 as well as in 10.3 - but they could have done it as conditional code.
It was ruled that there wasn't enough time to do it.) I knew there'd be
trouble in the newsgroup and mailing list when we tried to paste scripts for
readers to save.

Do a Google search for Smile script editor (it's free) and save the script
in Smile. Or maybe whoever fixes it can post it at Macscripter.net as a
script that will work in Entourage.


--
Paul Berkowitz
MVP MacOffice
Entourage FAQ Page: <http://www.entourage.mvps.org/faq/index.html>
AppleScripts for Entourage: <http://macscripter.net/scriptbuilders/>

Please "Reply To Newsgroup" to reply to this message. Emails will be
ignored.

PLEASE always state which version of Microsoft Office you are using -
**2004**, X or 2001. It's often impossible to answer your questions
otherwise.
 
Top