It worked intermittently for a time, but then stopped. Any thoughts on why please? (Also, if I remove the ‘perform mail action, etc', I get an error).
tell application "Mail" to activate # unnecessary?
using terms from application "Mail"
say 0
on perform mail action with messages theMessages for rule theRule
say 1
tell application "Mail"
if (exists rule "* items to shift") then
delete rule "* items to shift"
end if
set newRule to make new rule at start of rules with properties {name:"Move to '* items to shift'", move message:mailbox "* items to shift", enabled:true, all conditions must be met:true}
tell newRule
make new rule condition at start of rule conditions with properties {rule type:message content, move message:"* items to shift"}
end tell
end tell
end perform mail action with messages
end using terms from