Trying to figure out if this is even possible. I'm thinking to use JSZip to remotely access the .sketch file and unzip, but I am running into an issue with the documentation only suporting window ajax calls, or fetch which doesn't work in the context of sketch plugins.
Code so far that doesn't work:
const request = NSURLRequest.requestWithURL(NSURL.URLWithString("http://github.com/Stuk/jszip/zipball/master"))
const response = NSURLConnection.sendSynchronousRequest_returningResponse_error(request, null, null)
const _JSZip = new JSZip()
const file = _JSZip.load(response))
I am getting a response back, but it's in a bunch of hex data (which is good, i think?)
Running the above code results in
TypeError: undefined is not an object (evaluating 'zipEntries.zipComment.length')
So zipEntries must be undefined, but that's within JSZip so I'm not sure how to tackle.