Programmatically run Export > Export as Folder for a selection of macro groups?

I've managed to hack together an AppleScript that returns a list of modified groups after a certain date. I have the list (with their group UUIDs), but now I'm trying to figure out how to run Export as Folders for that list.

Is there any way to do that? Basically, the GUI equivalent is Command-clicking on a number of macro groups, then selecting File > Export > Export as Folders. I just want to do that from the code side without user involvement.