Newbie needs help saving e-mails as text files

I am new to Applescipt with a background in VB for applications. I am struggling to write a script that will step through the In Box in OS X’s Mail App and save all the e-mails, whose title matched a certain pattern or who have a given sender, as separate text files and then delete the e-mail.

I would appreciate a sample script showing how to step through each e-mail, test propertie of that e-mail such as the subject or the sender and then perform an action on the e-mail such as move save or delete.

Many thanks in advance.

TA