I wrote a javascript script that show/hide layers and save the document as PNG but Photoshop crashes around 4000 files generated.
Here is the way I save the file
const options = new PNGSaveOptions();
options.interlaced = true;
options.compression = 5;
doc.saveAs(File(fileName + ".png"), options, true, Extension.LOWERCASE);
When Photoshop crashes an error message like this is displayed 'Not enough memory'.
I tried to:
app.purge(PurgeTarget.ALLCACHES);Thanks !