Re: Archiving Mailbox contents
Re: Archiving Mailbox contents
- Subject: Re: Archiving Mailbox contents
- From: John Carlsen <email@hidden>
- Date: Mon, 24 Feb 2003 20:24:34 -0500
cricket wrote, on 2/24/03 5:29 pm EST (-5 hr):
>
Here's a sample script that will
>
archive the selected mailbox to a text file on your desktop, named
>
after the selected mailbox:
>
>
tell application "Finder" to set theHome to home as string
>
set theDesktop to theHome & "Desktop:"
>
tell application "Mail"
>
tell message viewer 1
>
set selectedMailboxes to selected mailboxes
>
repeat with eachMailbox in selectedMailboxes
>
set theName to name of eachMailbox
>
set thePath to theDesktop & theName
>
set theFile to open for access file thePath with write permission
>
set everyMessage to every message of eachMailbox
>
repeat with eachMessage in everyMessage
>
set theSource to source of eachMessage
>
write theSource as string to theFile starting at eof
>
end repeat
>
close access theFile
>
end repeat
>
end tell
>
end tell
I write and distribute a script that archives email from several
applications into a common FileMaker document, and I am adapting it to
support Mail, as many have requested.
My code is very generally similar to what you suggested, except that each
goes to a FMP record instead of a text file. I do not use the "source" but
rather the "content" because I do not want all the parts (text, html,
attachments, etc). But I have had reported problems from my beta testers.
(The beta referred to is at
<
http://homepage.mac.com/ThinkAgain/files/eMA3.10b3.sit>.)
I want the message body in a separate searchable FMP field, with subject,
etc. in different FMP fields. On every other Mac email app I've tried, this
has returned the text-only part if it is available (some call it body or
some such name instead of content).
There are several anomalies for this content object, but the oddest is that
on text-only messages, all the ">" comment marks have been removed. This
makes complex messages almost impossible to comprehend. On some html
messages, but not all, the field is empty.
Is there currently any way to get the original text body of a message, short
of parsing the source, which often has multiple parts - that I do not want?
Will this be fixed in future releases of Mail?
--
Cheers,
John
http://homepage.mac.com/ThinkAgain/Mac/eMA
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.