Spam Removal Macros

I'm uploading a few macros I developed to decrease the massive increase in spam emails I've been getting in Apple Mail. This includes a set of Macros that use timers to move junk folder mail to the trash folder and one for the Trash folder to delete the mail. Also, a set of macros to "block" mail senders that reside in either the junk or trash folders. Any improvements or suggestions are very welcome.

Title: Persistent Spam (Junk Folder), Timer
Use both a hot key and an "at time" trigger
Then, Open"/System/Applications/Mail.app"
then set up in Mail several Favorite folders and include "Junk" and "Trash" (or "All Trash). They will be assigned Cmd-number shortcut.
To capture all mail in the folder use the Command "type the keystroke" action, set to Cmd-A.
Next, Go to the Junk folder. To move Junk items to the Trash folder, use the { } Repeat Actions x Times action and set it in Menu: Mail, Menu Title: Mailbox, Submenu: Move to Favorite Mailbox, Menu Item: All Trash.
Separately, If you are in the Trash folder, use the Type Keystroke action Control-Z (to delete). I set this up using the Apple Systerm Settings, Keyboard control panel (for Ventura) "Keyboard Shortcuts" and set the Mail menu Edit so that Delete has a shortcut (it doesn't have to be control-z but you need a shortcut for this).
I've added some timed pauses of 1-2 seconds but they are optional.
To close Mail, use the Command-Type the Keystroke: Cmd-W.
Again, the above description was used for two separate Macros. One for working on the Junk Folder and one for the Trash folder.

To put the "Blocked" label on a spammer's address, I set up the following Macro...
Start with a Hot key Trigger.
First, use the Open"/System/Applications/Mail.app" action.
then set up in Mail several Favorite folders and include "Junk" and "Trash" (or "All Trash). They will be assigned Cmd-number shortcuts automatically in Mail.
Use the Cmd-number that selects the folder you want to block the top-line piece of mail in a "Type the Keystroke action."
Next is trickier (because I find coordinates tricky). I used the "Move and Click action. Set coordinates to "click", "right button" (no modifiers), at right arrow "490" and down arrow "146" (to highlight the top line). Keyboard Maestro has a "Mouse Display" option under KM Windows menu (also it's shortcut Cmd-5).
then use the action: Type (Down Arrow) Keystroke, with sim key "down arrow"
Repeat this action until the right-click window moves to the "block contact" option. It might be as many as 12 repeats.
Then I put a Pause for: 1-second action (just to see that the right click went to the right place).
Finally, use the Type (the Enter) Keystroke action, set Sim keystroke to "Enter"

If used on an already "blocked" email, it will unblock it.

I also set up a Multiblock Mail macro. This is quirkier (see below). Basically this uses the Execute Macro action with the title of the blocked Junk, line x Macro which was then set up to "block contact" lines two through however many you want to block. The line by line Macros were titled: Block Junk, line 1, Block Junk, line 2... (or a separate Macro if you want to do this in the Trash folder. The Multi-line blocker Macro then takes each individual line and sequentially blocks the mail. It's quirky if there isn't as many pieces of mail as Execute Macros, so currently I only have 3 lines and can repeat if needed.

Where have you uploaded them to?

I have been working on this for awhile and it's never perfect. The timer feature is useful to empty the mail trash folder on a regular basis (timing is whatever works for you) but I'd like a better (less complex) way to automate the block sender and immediate delete blocked senders (move from junk folder and trash folder).