I had a similar conundrum: how to copy a set of selected email messages
to a single text file. There may be an easier way - there has to be - but
this is how I solved it in AppleScript:
---- cut here -----
set numberOfMessages to 0
set msgTxt to ""
tell application "PowerMail"
-- get list of selected messages from PowerMail
set messageList to the current messages
-- none selected!
if messageList is {} then display dialog "No messages selected" buttons
{"OK"} default button "OK"
--iterate through list, collecting from, subject, and message body
repeat with aMessage in messageList
set numberOfMessages to numberOfMessages + 1
set msgFrom to sender of aMessage as string
set msgSubject to subject of aMessage
set msgBody to content of aMessage
-- append message data to msgTxt with some simple formatting
set msgTxt to ¬
msgTxt & return ¬
& "==============================" & return ¬
& "Message " & numberOfMessages & return ¬
& "==============================" & return ¬
& "From: " & msgFrom & return ¬
& "Subject: " & msgSubject & return & return ¬
& msgBody
end repeat
end tell
-- insert msgTxt into TextEdit and tell it to print the mess
tell application "TextEdit"
activate
make new document at the beginning of documents
set the text of the front document to msgTxt
print the front document
end tell
--- cut here ----
For some reason "sender of aMessage" has some garbage text up front. Not
sure why Powermail is returning this. It would be simple enough to cut
out. I live with it.
Hope this helps. Any suggestions welcome.
Leo
--
Leo Laporte <http://leoville.com>
KFI AM 640, Los Angeles Sat-Sun, Noon to 3p
Call for Help, Weekdays at 6 & 9p on G4techTV Canada
PO Box 1018, Petaluma, CA 94952 <mailto:[EMAIL PROTECTED]>
On Tue, 7 Sep 2004 09:47:00 +0100, david.gordon said:
>cheshirekat wrote on 06.09.04 at 13:31 -0600
>
>>Take a screenshot. Or use "Grab" type utilities.
>
>A screenshot isn't going to work for a list of 300 messages! Not unless
>you have a bigger screen than me ;)
>
>"Grab" type utilities? What are you thinking of here?
>
>>Use AppleScripts.
>
>Someone more clever than what I is might like to post some general
>pointers to get me started...?
>
>Thanks
>
>--
>david.gordon
>
>
>