Applescript and Mail

Given the following code, how do I define, in Apple Script, the currently selected message which is the message I want to move:


set DeleteThis to ""

tell application "Keyboard Maestro Engine"

set DeleteThis to getvariable "theMajorDomain"

end tell

tell application id "com.apple.mail"

move currentmessage to mailbox "Junk" of account "Lindscape"

tell rule "Delete"

make new rule condition at end of rule conditions with properties {rule type:from header, qualifier:does contain value, expression:DeleteThis}

end tell

end tell

Posted on Jul 9, 2022 12:21 AM

Reply

Similar questions

1 reply

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Applescript and Mail

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.