So I explored further the feasibility of doing this within the running game. Here's the current test:
dropbox.com/s/8m6rjr46xx5fhn8/js_readcapxFile.capx
It's piecing together the necessary parts and very wip atm so it's a bit messy. Mostly a lot of asynchronous calls. A final step if I works well will be to simplify everything best I can.
What it does?
It can show a open file dialog, load a capx file as a zip and access files inside.
I also was able to make it save the zip again. It's not possible to show a SaveAs dialog from JavaScript so it just invokes a download of the file. Maybe if I decide to go the nwjs route...
The file I decided to open was the .caproj file since it has a list of the layouts, and I wanted to see how easy it was to get info from a xml file. First snag was there was three garbage characters at the start of the xml that prevented it from parsing. Fixed that and found out navigating xml is a pain. I tried doing it with the xml plugin and in javascript. Also the xml plugin doesn't let me modify data, only read it.
So I made a converter to convert the xml to json so it's easier to navigate, copy and modify in various ways. The plan it to also convert it back to xml when done if I want to save changes.
What is left to do?
* Convert the json back to xml for saving.
* Do some manipulation of instances on a layout. Initial things I had in mind were changing positions, duplicating instances, and destroying instances. Probably will make a simple ui for that purpose.
* Save a completed new capx file with the modifications.
It's mostly all done in js, and doing it in a plugin would be too restrictive, and doing it in straight events would take too long and be slow and hard to reuse.
Anyways cheers.