Mac Mail AppleScript That Worked in Snow Leopard Doesn't Work in Lion

I have an email script that worked fine in Mac OS X Snow Leopard. It is simply a script that allows for AND/OR boolean logic combined together to trigger one (rarely two) of the following actions:

  1. Move message to archive folder
  2. Delete email message (move to trash)
  3. Forward the message to someone
  4. Color the message (to signal importance)

You can review the script here. http://dl.dropbox.com/u/13354075/MacMailScript.scpt The bulk of the script is simply just the boolean conditions I’m looking at. And yes, I know my several ‘else if’s’ could have been combined into fewer if statements, but I just found it easier to have each ‘condition’ that I’m looking for in its own if statement.

I can’t recall where I first downloaded the template for this script (as I had never written any scripts before), but it was from an Apple page that was a ‘sample email script’ (or possibly from the sample scripts installed with OS).

As I said, in Snow Leopard, everything worked fine, but in Lion I get some strange behavior. My Inbox gets tricked/stuck thinking it has emails to download. Basically every message that would have been ‘moved/deleted’ somehow doesn’t get flagged as processed on my POP3 server. So every time I get mail, I see the following under Mail Activity (Incoming Messages… X of Y where Y is the growing number of emails affected by my script) yet nothing new is downloaded.

If I turn my Mail Rule off that runs the script, all emails are redownloaded again into my Inbox.

Last couple points:

I’m connecting to POP3 accounts

I used to use Growl 1.2.2, but I disabled that on a hunch that it wasn’t compatible with Lion. You’ll still see a sendGrowl function in the script, but you’ll notice that the entire function body is commented out.

Any suggestions or ideas on how to get this working again so I could tame my inbox would be EXTREMELY appreciated.

Thanks in advance.