Can't save png with extendscript uxp, getting "is not defined" error
I just started learning photoshop scripting with extendscript, and am utterly unable to figure out how to get it to save a file, I looked in a few places on the internet, including here, adobe community forums, scripting ref ebooks, chatgpt, and saw a lot of suggestions from people and robots who seem to have gotten it working, but none of them is working for me.
Here is a list of methods I tried, which are all giving me the same error. I only included the line of code which threw the error, which is usually the very first line that deals with defining a File object, I can't even get past that part.
var expFile = new PhotoshopSaveOptions();
Uncaught ReferenceError: PhotoshopSaveOptions is not defined
var pngFile = new File("D:/temp/test.png");
Uncaught ReferenceError: File is not defined
var pngSaveOptions = new PNGSaveOptions();
Uncaught ReferenceError: PNGSaveOptions is not defined
var saveOptions = new JPEGSaveOptions();
Uncaught ReferenceError: JPEGSaveOptions is not defined
var options = new ExportOptionsSaveForWeb(); options.format = SaveDocumentType.PNG;
Uncaught ReferenceError: ExportOptionsSaveForWeb is not defined
var options = new ExportOptions(); options.format = SaveDocumentType.PNG; options.transparency = true;
Uncaught ReferenceError: ExportOptions is not defined
I'll keep looking and experimenting, but if you have a solution for me, I'd very much appreciate it.
