As I scroll through emails on my Mac, I encounter a lot of junk that I right click, select Block Sender, then right click again and select Delete. I’d like to automate that so when I encounter one of those emails, I’d have a keyboard combination to launch either Automator or AppleScript to do both of those things one after the other. I figured out how to get the current email with Automator and how to insert AppleScript into it, but I can’t find an AppleScript command to block the sender.
There is no AppleScript access to Block Sender.
The closest you’re going to get is likely UI scripting to emulate what you do manually, with all the caveats that come along with UI scripting (for example, OMM (Sequoia/15.4) it’s now Block Contact rather than Sender.)
Thank you. I tried “Watch Me Do” in automator, but right clicking stops the recording which prevents me from even selecting Block Sender. On an unrelated note, I have 15.3.1 and update tells me I’m up to date so I suspect since you have 15.4 which may be only for Apple Silicon Macs, it way be time for a new Mac Mini.