Copy link to clipboard
Copied
Hi,
I am currently working on a script that lets the user export an image in various resolutions (first photoshop script I'm working on...).
there is the method Document.exportDocument, but I can only use ILLUSTRATORPATHS or SAVEFORWEB as export type, which is equivalent to File > Export > Paths To Illustrator or File > Save for Web and Devices (see documentation), the latter being replaced by File > Export As... in more recent versions of photoshop CC.
So far I wasn't able to locate the javascript scripting reference for CC 2016 and later, hence my question: does anyone know either where to find the javascript reference or what the corresponding function is to do a File > Export As... in the script?
I'd prefer not to use the legacy save for web since the quality of the new export as is way better at the same filesize.
best,
peter
"Export As ..." is an extension. Its actions are not recorded ..
Why do not you use the simple "Save As" method, setting the parameters you want for a particular format?
Copy link to clipboard
Copied
//File->Export As...
app.runMenuItem(stringIDToTypeID("exportDocumentAsDialog"));
//Layer->Export As...
app.runMenuItem(stringIDToTypeID("exportSelectionAsDialog"));
Copy link to clipboard
Copied
sorry, should have provided a few more details as it seems...
that does work, thx, good to know, but I want to run the command without the dialog actually popping up, just pass some arguments like format, quality, width, height and so on.
Copy link to clipboard
Copied
"Export As ..." is an extension. Its actions are not recorded ..
Why do not you use the simple "Save As" method, setting the parameters you want for a particular format?
Copy link to clipboard
Copied
damn, i feared so...
then I'll have to fall back to the save as, yes, would've been cool if there was an export as function with all the parameters you can set in the dialog, but should work anyways, thx for your advice!
Copy link to clipboard
Copied
Thank you, it works!
How can I confirm and click the "export" button after the dialog box?