Deleting Messages in Big Sur

Hi there, I'd like to create a Keyboard Maestro shortcut to delete messages and message threads in Messages.app in Big Sur, in a similar way to how I can Delete or Command-Delete in any other Mac app. I built one that worked in Catalina, but it seems to me that they've universalised the codebase in Big Sur in such a way that I can't use the usual 'Select or Show a Menu Item'... Please let me know if you have a process that works. Thanks, Andrew

In my quick research, I found that the new Messages app still supports AppleScript, and in the library section for Messages, there are commands for Delete and methods for selecting the unique ID of the chat. I'm not skilled enough to put this together for you, but I hope this is a start to something. I've also had success with UX Scripting in Messages, even in Big Sur.

Hi Ibnabouna, Thanks for getting back to me. I found a way to script the interface using a right-click action I didn't know about. Thanks for suggesting that I try again, Andrew

1 Like

Andy - if you find a good way to accomplish this, can you post it? I had the same shortcut to delete message threads in Catalina, and so any solution that you come up with would be appreciated.

Hi there jevaud, Here's my KM script. I don't know if it's the most efficient way of doing it, but it works :wink:.

Thank you! Works perfectly. When I asked my question, my existing macro to delete messages had stopped working, and now it works again, using the "Select Menu" item in KM. See attached. Delete Message.kmmacros (2.8 KB)