• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Export as... script

Community Beginner ,
Nov 14, 2017 Nov 14, 2017

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

TOPICS
Actions and scripting

Views

4.7K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

People's Champ , Nov 14, 2017 Nov 14, 2017

"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?

Votes

Translate

Translate
Adobe
People's Champ ,
Nov 14, 2017 Nov 14, 2017

Copy link to clipboard

Copied

//File->Export As...

app.runMenuItem(stringIDToTypeID("exportDocumentAsDialog"));

//Layer->Export As...

app.runMenuItem(stringIDToTypeID("exportSelectionAsDialog"));

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 14, 2017 Nov 14, 2017

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Nov 14, 2017 Nov 14, 2017

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 14, 2017 Nov 14, 2017

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!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 24, 2020 Nov 24, 2020

Copy link to clipboard

Copied

LATEST

Thank you, it works!

How can I confirm and click the "export" button after the dialog box?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines