Import Mail.app messages to Eudora
Import Mail.app messages to Eudora
- Subject: Import Mail.app messages to Eudora
- From: John Delacour <email@hidden>
- Date: Thu, 7 Nov 2002 01:30:29 +0000
- Mac-eudora-version: 5.3a8
I posted some trial versions of this script on another list, but I
think this latest version is the ticket.
You can either run this script from an editor or put it in your
scripts folder and run it from the menu or a toolbar button.
The script creates a dropfile and a personality to enable you to
import the messages just as if you were checking mail on the server.
Attachments are included. The Deleted Messages mailbox is skipped.
The script should deal with any depth of sub-folders, importing
messages from all mailboxes.
An extra header is added to the messages to enable you to filter them
to a mailbox other than "In". Full instructions are sent to you when
you run the script.
The process is amazingly fast. Please let me know of any problems.
-- JD
(* Script: Import from Mail.app *)
set dropfile_ to "" & (path to startup disk) & "private:tmp:dropfile.mbx"
set perlscript_ to do shell script "perl -e '
use File::Find ;
$dropfile = qq~/tmp/dropfile.mbx~ ;
chomp ($date = `date`) ;
$date =~ s~\\s+~ ~g ;
$date = qq~$date\\015\\X-Imported-From-Mail.app: true~ ;
open DROPFILE, qq~>$dropfile~ or die $! ;
$dir = qq~$ENV{HOME}/Library/Mail~;
chdir $dir;
find (sub {/^mbox$/ and push @ls, $File::Find::name}, qq~$dir~) ;
for (@ls) {
next if /Deleted Messages/ ;
open MAILBOX, $_ ;
for (<MAILBOX>) {
chomp ;
s~(^From )([^\\s]+)(.+)~$1???@??? $date~g and $count++;
print DROPFILE qq~$_\\015~ ;
}
s~^.+Mail/~~g;
s~\\.mbox/mbox$~~g ;
$list .= qq~<div>$_</div>\\n~ ;
}
print qq~$list|*|$count~
'"
set AppleScript's text item delimiters to {"|*|"}
set {boxes_, count_} to perlscript_'s text items
set AppleScript's text item delimiters to {""}
tell application "Eudora"
set persname_ to "Import_from_Mail"
if not (exists personality persname_) then
set p to make personality
set name of p to persname_
end if
tell personality persname_
set its setting 3 to "!" & dropfile_
set its setting 5 to "Script@127.0.0.1"
set its setting 4 to "[not applicable]"
set its setting 77 to "Script"
set its setting 83 to "y"
end tell
set m to make message at end of mailbox 1 with data "From: Script
To: " & setting 77 & "
Subject: Messages from Mail.app
Content-Type: text/html
<html><font size='+1' face='Geneva' color='navy'>
<h2><font color='#337733'><hr height='3'>
You have " & count_ & " messages from Mail.app ready for collection.<p>
</font></h2><hr>
If you want to have these messages in a special place,
<ol>
<li>Create a mailbox for
imported messages, eg. “Imported”</li>
<li>Set up a filter at the <b>top</b> of your filter list
<ul>
<li>Type “X-Imported-From-Mail.app”
in the top box</li>
<li>Type “true” in the second box</li>
<li>Set action 1 to
“open” and check “mailbox”</li>
<li>Set action 2 to
“Transfer To” (“Imported”)</li>
<li>Set action 3 to
“Make Personality”
(“you choose”)</li>
</ul>
</ol><p>
To get the messages from... <hr><font size='0'>
" & boxes_ & "</font><hr>...type <b>cmd-opt-m</b>
and check mail for personality “Import_from_Mail”.
<br>If you are asked for a password, type anything.
<p>
Type <b>cmd-d</b> to delete this message.
</font><html>"
set personality of m to personality persname_
open m
activate
end tell
-- END
_______________________________________________
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.