On Sat, Dec 11, 20043:13 PM, the following words from Giovanni Andreani
[EMAIL PROTECTED], emerged from a plethora of SPAM ...

>...
>>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>
>>
>>HTH
>>
>>cheshirekat
>
>Thank you Cheshirekat
>
>I've tried the above script, but the result is the same first message
>copied so many times as the number of the total selected messages
>Giovanni
>
>
Ok, sorry about that. I now see what was wrong. the repeat statement has
an extra line I was using for testing while removing extra stuff that I
have in my personal scripts. ( For some reason I've made the mistake of
leaving test pieces in several scripts I've been working on this week, so
I knew exactly what the problem was when you said the same message was
copied multiple times. The advantage of making your own scripts is that
no one sees the many mistakes you make. When I share scripts I've
created, I try to remove commented lines, extras that may not be
applicable for general use, and error-checking snippets, but sometimes
make errors in the cleanup.) Remove this offending line:

   set the targetMsg to (the first item of the msgList)

The script should look like this:

<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 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>

As someone else mentioned, BBEdit Lite doesn't support AppleScript. I
don't think the lite BBEdit versions have ever included scriptability in
the many versions I have tried prior to OS X. I haven't tried any OS X
versions since I haven't been interested in any text editors that
expensive. So, you could use other applications, like TextEdit,
AppleWorks, Microsoft Word, or whatever you are comfortable with to make
the script a little more "automatic" if they support AppleScript. I send
my messages to a FileMaker Pro database I created with AppleScripts, and
I also send messages to plain text files frequently. 

HTH

cheshirekat



Reply via email to