I use Script Debugger, but you could use Apple's Script Editor also. I don't see the error you're getting, but I would start by uncommenting out the two lines in the AppleScript that suppresses the debugging info. The two lines start with "set theAnswer"... This should tell you what MailFolder thinks the selected mailbox is. Beyond that, you could use KM to "try ... otherwise ... end try" action to give more info. Unfortunately, I don't have time right now to dig more into this.