[SOLVED] How to Delete a Macro Group Using Another Macro?

Hello! I'm trying to create an "update" macro that when run will delete a certain macro group and then import a new one with almost the same name (only difference is version number tag on the macro group).

Through research it seems that an AppleScript action might be the best way to do this, but I have never used AppleScript before. I found this which works to delete a macro group of a particular name:

Screen Shot 2022-10-26 at 9.51.55 AM

But since the name of the macro will be slightly different every time, I'm looking for the syntax that says the macro group name "contains" or "begins with". This is what I thought would work, but it's throwing an error:

Screen Shot 2022-10-26 at 9.52.06 AM

I think I just have the syntax wrong?

Also, I'm thinking that maybe the macro ID could work too, how do I delete using the UUID?

Thank you!


tell application "Keyboard Maestro"
	delete (every macro group whose name begins with "Get Course info MACROS")
end tell

It needs every because whose name begins with... will return a list, even if that is a list containing only one item.


Genius! That worked, thanks so much, I knew I was so close!