Moving all messages in multiple mailboxes.

I am looking for something that would be perfect for applescript but as an applescript beginner I cannot get started.
I have an IMAP mail account with a lot of mailboxes, mail gets delivered by serverside rules into some of them.
Once in a while I want to move all messages in some of those mailboxes to local mailboxes with the same name.

No need to do this automatically using rules but a script which I can run maybe once a week would be perfect.
Any hints on how to get started ??
BTW This should work on 10.3 so automator is out of scope…


Model: powerbook
Browser: Safari 412
Operating System: Mac OS X (10.3.9)