On Wed, Sep 22, 200422:45, the following words from Dr Dave drdave-
[EMAIL PROTECTED], emerged from a plethora of SPAM ...

Ok, then Dave. I'm going to go out on a limb here since I haven't tested
the script you posted, nor have I the time to write the same script from
scratch. Let me know if these instructions don't make sense to you and
I'll reply when I can if other scripters here don't.

Step 1: Change the text "Claris Emailer" to the text "PowerMail" in the
script you posted that was created by Allen Watson. 
Step 2: See if the script will compile and run from the script editor.
(Backup!)
Step 3: If you complete the above step without error, save the script
wherever it is you prefer to save your PowerMail scripts.

(I see nothing in the script that would prevent it from running in
PowerMail, except the fact that it is addressed to "Claris Emailer" which
was indeed a GREAT email application I also used before using PowerMail.)

I don't ask or expect anything for any of my scripts, although someday
I'll get around to posting more than a smidgen to my web page. I make
scripts because I have a need for them, I enjoy creating them, and I know
that others find some AppleScripts useful to use and learn from. With
winter around the corner, chances are that I can cut back on time spent
trying to earn a living and indulge in a few of my favorite Mac
activities. However, I would never turn down an iPod from anyone so
inclined to send one my way. (Just kidding - well kind of.)

cheshirekat

>-- Script to replace message of open Emailer message with clipboard contents
>
>-- Allen Watson, 5/25/99
>tell application "Claris Emailer"
>       activate
>       try
>               set theMsg to the displayed message of the front window
>       on error
>               display dialog "There must be an open message for this script 
> to work"
>               return
>       end try
>       try
>               set theCopy to (the clipboard) as text
>       on error
>               display dialog "Cannot access clipboard; may be empty."
>       end try
>       if length of theCopy = 0 then
>               display dialog "Clipboard empty; nothing to replace WITH"
>               return
>       end if
>       try
>               set snippet to text 1 thru 60 of (theCopy as text)
>       on error
>               set snippet to theCopy as text
>       end try
>       display dialog "Choose: Replace entire message contents with clipboard?
>or replace selection?
>1st 60 characters are: " & snippet buttons {"Contents", "Selection",
>"Cancel"} default button 1
>       set theChoice to button returned of result
>       if theChoice = "Cancel" then return
>       if theChoice = "Contents" then
>               set the content of theMsg to theCopy
>       else
>               set theWindow to the front window
>               set theSel to selection of theWindow
>               set howLong to length of theSel
>               if howLong = 0 then
>                       display dialog "Nothing selected."
>                       return
>               end if
>               set theWhole to content of theMsg
>               set whereTo to (offset of theSel in theWhole)
>               --Pick out parts before and after theSel; handle when first/last
>character selected
>               if whereTo <= 1 then
>                       set partA to ""
>               else
>                       set partA to text 1 thru (whereTo - 1) of theWhole
>               end if
>               if (whereTo + (length of theSel)) >= (length of theWhole) then
>                       set partB to ""
>               else
>                       set partB to text (whereTo + howLong) thru -1 of 
> theWhole
>               end if
>               set theNew to partA & theCopy & partB
>               set the content of theMsg to theNew as text
>       end if
>end tell

-- 
Great art is as irrational as great music. It is mad with its own loveliness. 
-  George Jean Nathan (1882 - 1958) 

* 867 PowerBook G4 * OS X 10.2.8 * 768 MB Ram *
* Addictions: iTunes * AppleScript * Mike's Cards * FileMaker Pro *



Reply via email to