I want to trigger the running of Mail rules on a specific mailbox folder, using Automator. I'd run this every hour.
Specifically, I want to run rules on messages in my junk mail folder to delete the obvious junk, making it easier to then spot real messages that have been accidentally classified as junk. I can force the rules to run by selecting the folder, selecting all messages, then using 'apply rules'. The rules don't run automatically, I believe because Hotmail has already run rules on the server to place them in Junk in the first place, marking the messages as 'seen' in the process. Mail doesn't run rules on 'seen' messages.
I'm a complete Automator/applescript newbie. Can anyone tell me how to achieve this?
So far I have tried using 'get specified mail items' and 'get selected mail messages' to choose the correct messages, but can't work out how to then run existing Mail rules on them.
I've also tried recording selecting the Junk folder, pressing cmd-a (select all) and cmd-opt-l (apply rules), but this gives an error about clicking static text.