I am trying to create a script in Photoshop that will change some layers and export them as a PNG image. I copied the following code from another place:
function SavePNG(saveFile){ var pngOpts = new ExportOptionsSaveForWeb; pngOpts.format = SaveDocumentType.PNG pngOpts.PNG8 = false; pngOpts.transparency = true; pngOpts.interlaced = true; pngOpts.quality = 100; activeDocument.exportDocument(saveFile,ExportType.SAVEFORWEB,pngOpts); }
The function exports the active Photoshop document to the file specified by the saveFile parameter.
It works fine with simple paths like "C: \ images \ result.png", but when you try to use different paths like "~ / Desktop /" or paths with some special characters, the file is not exported, but the "target" folder does not exist "error message appears.
Any idea how I can solve it?
source share