19/01/04 <[EMAIL PROTECTED]> :

>Is it possible easily to change something so that one can make changes to 
>mail designated "read only" by CE, such as incoming mail in the In Box.  
>For example, if one wanted to ROT encode an incoming email, the 
>AppleScript says it can't do this because the selected text (the body of 
>the incoming email) is "read only."

You can do it with AppleScript (and only with AppleScript). Once the 
content is altered, you can still cancel by choosing not to save the 
changes, like in outgoing messages.

There's nothing special about incoming messages from AppleScript's point 
of view. I guess if your script barks at you then it was designed to 
refuse to change incoming mail.

Example (what will appear as paragraphs due to mail wrapping should be 
pasted in a script editor as single lines):
(*

That's a simplified version of my script "Convert Win text to Mac" to 
give you an idea of how to do it; ask me if you want me to release this 
script. It uses the Satimage osax to convert Emailer's front message to 
Mac text (assuming it's Windows text), but of course you don't need any 
osax to alter the content, it's just the first example I found.

*)

-- example script
tell application "Claris Emailer"

        set theWindow to the front window

        if the class of theWindow is in {incoming message window, outgoing 
message window} then

                        set theText to the content of the displayed message of 
theWindow

                        set the content of the displayed message of theWindow to 
convert to 
Mac theText -- uses the "convert to mac" command from the Satimage osax

        end if

end tell
-- end example script

-- you can replace [convert to Mac theText] with whatever you want to do 
to the content
-- AppleScript has a lot of interesting text commands, like [word 5 of 
third paragraph of theText]
-- (or negative values to count from the end)

>This is a "cake and eat it,too" issue, I realize, as one could make a 
>complete copy of the email, make the changes, etc., but I would like to 
>be able to do it on the same email without having to make a copy to do 
>what I want.

The problem is there's a limitation to forging a copy of incoming message 
with AppleScript: the forged one will lack attachments if the original 
had some (I couldn't find how to do it for my "1945" script, which had to 
forge a replacement message because you can't change the date of existing 
messages).

Anyway, changing the content or subject doesn't require any special 
effort: AppleScript treats incoming and outgoing messages exactly the 
same, it's just Emailer's interface that prevents you from altering 
incoming messages manually.

----
VRic

___________________________________________________________________________
To unsubscribe send a mail message with a SUBJECT line of "unsubscribe" to
<[EMAIL PROTECTED]>  or  <[EMAIL PROTECTED]>

Reply via email to