The handler speaking to Numbers use two undefined variables.
Sorry, that’s just because I edited the script down for posting and forgot to include those two.
I should also have mentioned this is on 10.11.6, not Sierra.
I assume that it's just something forgotten in the mail but maybe not.
No, it’s operating on the same mail message both when it fails and when it works.
To be clear, after editing, compiling and then closing the script, I test it by choosing an appropriate message in Mail, right-click it and choose ‘Apply Mail Rules’. Nothing happens. I then right-click again, and choose ‘Apply Mail Rules’ and the second time it works, and it continues to work on new mails coming in after that (until I edit the script again).
Why it fails on the first test is the mystery.
Best
Phil |