5/12/02 20:23 mikael bystr�m :
>>"Avoid QP truncation
>Where can I find this script. I couldn't see it at Fogcity.
I don't know, so here it is (don't know who wrote it):
------------- "Avoid QP truncation" script -------------
-------------- beware of email line breaks -------------
---------- or Script Editor will bark at you -----------
(*
Addresses the bug in Emailer 2.0v3 where some outgoing messages
get truncated due to a point being wrapped at the end of a paragraph.
Version 1.1 7/1/98
*)
tell application "Claris Emailer"
if the class of the front window is outgoing message window then
set theContent to the content of the displayed message of the front
window
set newContent to ""
set lineChange to false
repeat with currentParagraph in the paragraphs of theContent
if length of currentParagraph is greater than 70 then
if character 1 of the currentParagraph as string is
">" then
if character -1 of the currentParagraph as
string is "." then
set currentParagraph to
currentParagraph & space
set lineChange to true
end if
end if
end if
if newContent is "" then
set newContent to currentParagraph
else
set newContent to newContent & return &
currentParagraph
end if
end repeat
set the content of the displayed message of the front window to
newContent
if lineChange then
display dialog "A space was added to the end of at least one
line �
to prevent message truncation."
else
display dialog "No changes were necessary to prevent message
truncation."
end if
else
display dialog "No action taken. This script requires that an outgoing
message be open in its own window."
end if
end tell
------------- end of "Avoid QP truncation" script -------------
>>- messages from hotmail (rarely other mailers, depends on their
>>settings), easily handled by dirty scripts of mine that send the text to
>>a browser and get the correct result from it (I had planned a much
>>cleaner approach, but got lazy when my first test script proved good
>>enough, I only intended to use iCab to test encodings, but well, in
>>France "temporary" means "forever");
> Please share these?
I'm usually happy to share scripts, but I'm not proud of these since I just hacked
around to explore the issue, then got lazy and didn't polish a real fix. What I do is
easy to replicate:
- "Open in iCab" script (I use Cmd-Opt-O)
This one is really dirty because it does unnecessary complicated things like merging
many messages and parsing some content, so I won't share it, but it only needs to
store the message in a text file and open it in iCab, which should be trivial using
one of many existing "save to text" scripts as a starting point.
I did that to find out what encodings I was getting using the browser's "Text
encodings" menu. As iCab usually gets it right away, that's where I realized the
problem wasn't worth a dedicated fix, since I could read the message there after all,
like I already do for HTML messages.
Yet I sometimes want to keep the message in it's correct form, and since I already had
a script to replace an incoming message with the clipboard, I just copy what want,
switch to Emailer and:
- "Replace with clipboard" script (I use Cmd-Opt-V)
I'm adding translations of the french parts and commenting out the originals.
Do the opposite to get the french version back.
That's OK, just buy me a beer sometime.
------------ "Replace with clipboard" script ------------
-------------- beware of email line breaks --------------
----------- or Script Editor will bark at you -----------
(*
This script replaces the content of Emailer's front window (incoming or outgoing
message)
with the content of the clipboard, creating a new message if none is open.
Comment out french or english parts to your liking.
Ce script remplace le contenu de la fen�tre au premier plan d'Emailer
(messages entrants ou sortants) par celui du presse-papier,
en cr�ant un nouveau message si aucun n'est ouvert .
VRic, 05/01
*)
on run
try
set theText to the clipboard -- as text
on error
-- display dialog "Probl�me, peut-�tre n'y a-t-il pas de texte dans le
presse-papier." with icon stop
display dialog "Problem, maybe there's no text in the clipboard." with
icon stop -- english version
end try
tell application "Claris Emailer"
activate
set theWindow to the window 1
set windowClass to the class of theWindow
if (windowClass as text) contains "message window" then
set theTitle to the name of the displayed message of theWindow
if theTitle is "" then
-- set theTitle to "ce message"
set theTitle to "this message" -- english version
else
-- set theTitle to "� " & theTitle & " �"
set theTitle to "\"" & theTitle & "\"" -- english
version
end if
-- display dialog "Remplacer le contenu de " & theTitle & "
par celui du presse-papier ?"
display dialog "Replace the content of " & theTitle & " with
that of the clipboard?" -- english version
-- the dialog exits the script if the user clicks "Cancel", so
I don't need to handle the result of the dialog
set the content of the displayed message of theWindow to
theText
else
set theMessage to make new outgoing message with properties
{content:theText}
open theMessage
end if
end tell
end run
------------- end of "Replace with clipboard" script -------------
----
VRic
___________________________________________________________________________
To unsubscribe send a mail message with a SUBJECT line of "unsubscribe" to
<[EMAIL PROTECTED]> or <[EMAIL PROTECTED]>