On Tue, Dec 7, 200410:47 AM, the following words from Giovanni Andreani
[EMAIL PROTECTED], emerged from a plethora of SPAM ...

>Is there any way I can automatically copy the content of a message, paste
>it in a text editor (Bbedit), go to the next message and repeat the same
>action until the last message in the folder is copied?
>Am I asking to much?

What do you mean by automatically? Do you want it to always act on all
the messages of the same message folders? Do you want to select the
folder, then activate the script to act on all messages in only that
folder? Do you want to paste each message into a BBEdit document, or all
the selected messages into one new BBEdit document, or all the messages
into an already open BBEdit document? There are a lot of ways to
accomplish what you want to do with AppleScripts.

I don't use BBEdit, but here's an example of getting all the selected
messages into one new PowerMail message with AppleScript, which you could
then select and copy to BBEdit:

<Begin AppleScript>
property ret : return
property rr : ret & ret
property fromLead : "From: "
property dateLead : "Date: "
property subLead : "Subject: "

to sendTheTxt from the txt
   tell application "PowerMail 5.1"
      set the newMsg to make new message with properties {content:txt}
      set the status of the newMsg to draft
      open the newMsg
   end tell
end sendTheTxt

tell application "PowerMail 5.1"
   set the sumText to ""
   set the msgList to the current messages
   repeat with targetMsg in the msgList
      set the targetMsg to (the first item of the msgList)
      set the targetMsgSender to the targetMsg's sender
      set the sName to the targetMsgSender's display name
      set the sAddr to the targetMsgSender's email address
      set the sentDate to the targetMsg's time sent as text
      
      set the msgSub to the targetMsg's subject
      set the msgBody to the targetMsg's content
      set the sumText to (the sumText & fromLead & sName & " " & sAddr &
ret & dateLead & sentDate & ret & subLead & msgSub & rr & msgBody & rr)
   end repeat
   sendTheTxt of me from the sumText
end tell
<End AppleScript>

If the text editor you wanted to use is Apple's TextEdit, you can replace
the sendTheTxt subroutine with this one:

to sendTheTxt from the txt
   tell application "TextEdit"
      set the newTxtDoc to (make new document at the beginning)
      set the text of the newTxtDoc to the txt
   end tell
end

If you want to work with message folders that are currently selected, you
could use something like this:

tell application "PowerMail 5.1"
   set the ccList to the current containers
   if the ccList is not {} then
      set the ccListCnt to count the ccList
      repeat with fldr in the ccList
         set the msgList to the messages of fldr
         if the msgList is not {} then
            -- do your stuff here
         end if
      end repeat
   end if
end tell

HTH

cheshirekat

-- 
Words express neither objects nor ourselves. 
  
-   Johann Wolfgang Von Goethe (1749-1832)

* 867 PowerBook G4 * OS X 10.2.8 * 768 MB Ram *
* Addictions: iTunes * AppleScript * iLife 4 * FileMaker Pro *



Reply via email to