Entourage 2004 scripting IMAP

G

Geoffrey F. Green

Hi --

I'm trying to work on an Applescript to move folders from a POP
account to an IMAP account, and do so while preserving the "received
date."

Moving & copying directly doesn't work. So I tried this, which
contains some code modified from a script included with Spamsieve, but
it didn't work either. I get the error "Microsoft Entourage got an
error: Can't make class incoming message." Thoughts? Thanks.

tell application "Microsoft Entourage"
set acct to IMAP account "IMAP Account"
set thefolder to folder "Mailing lists" in folder "INBOX" of acct
set msgs to current messages
repeat with m in msgs
set msource to the source of m
set ifRead to read status of m
make new incoming message at thefolder with properties
{account:acct, source:msource, read status:ifRead}
end repeat
end tell

- geoff
 
E

Evan Gross

Hi --

I'm trying to work on an Applescript to move folders from a POP
account to an IMAP account, and do so while preserving the "received
date."

Moving & copying directly doesn't work. So I tried this, which
contains some code modified from a script included with Spamsieve, but
it didn't work either. I get the error "Microsoft Entourage got an
error: Can't make class incoming message." Thoughts? Thanks.

<snip>

I just encountered the exact same issue moving from POP to IMAP this past
week. I don't think there's any good way to solve this via AppleScript.

BUT I did find this absolute gem of a Python script that nicely solved the
problem. Takes some time because it has to download, fix up, then upload
each message, but works like a charm.

See <http://www.amunra.co.uk/archives/000068.php>

I just use BBEdit to create/modify the script as needed, then Run in
Terminal to watch the progress.

The only issue I ran into was the "import imaplib2" statement - had to
change that to "import imaplib" because that's what's installed in
/System/Frameworks/Python.framework/... (on Tiger, anyway). No idea what the
difference is between the two libraries, I didn't bother to find out after
seeing that it actually worked.

Hope that helps!
Evan Gross
Rainmaker Research Inc.
(Spell Catcher X author)
 
Top