Automate the Deletion Of iMessage

I was wondering if there was a way to automate the deletion of iMessages on a MAC?
Right now I use CMD OPTION K and then RETURN in succession.

Cmd⟩⟨Alt⟩⟨K⟩ clears the chat transcript, but I don't think it necessarily deletes the message itself, which will still be stored on your system. ⟨Cmd⟩⟨Backspace⟩ deletes the message.

However, when you say you wish to automate the deletion of messages on a Mac, what do you mean exactly ? Do you want the deletion to occur in response to some other event or trigger, or do you just want all messages deleted at this very moment ?

▸ To delete all messages right now, you could select them all and press ⟨Cmd⟩⟨Backspace⟩ followed by ⟨Enter⟩.

▸ To have deletion occur in response to a trigger, that would require some sort of scripting solution, and depends on what the trigger is. If you wanted them automatically deleted upon arrival, simply turning iMessage off would be the most reliable solution. But if you wanted all messages to be deleted once every 24 hours, that can be done with using a launchd .plist that gets loaded into the launchctl program with a reference to a script file that it instructs the system to execute at specific times or set intervals, e.g. every 24 hours, or every day at 9a.m.

The scripting aspect will likely be in the form of an AppleScript, which has the ability to interface with and control the Messages app, albeit it with several bugs in it that mean some commands don't work (but I believe deletion is easy enough to do).