Add/Update "Available in these applications" programmatically?

Is it possible to add/update apps to a macro group's "Available in these applications" programmatically?

I found this thread Globally change target application? where Peter says it's possible via AppleScript - but the thread is about changing apps in "Open with" actions, so I'm not sure if it's save to do the same with "Available in these applications".

Background is that I'd like to get all apps of a subfolder and add/update them in some macro groups. That's a repeating task so I don't want to do it in BBEdit.

I could script this but don't know

  • if it's safe to change

    ~/Library/Application Support/Keyboard Maestro/Keyboard Maestro Macros.plist

  • if it's the only file I need to change

  • how and what I should backup before trying