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

Script, Save for web options , set image size to 1200 px

Contributor ,
Nov 14, 2022 Nov 14, 2022

Copy link to clipboard

Copied

Hi!

It is possible to set image size, for example, to 1200 X 1200 pixels, when exporting for web using script?

function exportoptions(){
//jpg options
var jpgoptions = new ExportOptionsSaveForWeb();
jpgoptions.interlaced = false;
jpgoptions.quality = 50;
jpgoptions.includeProfile = false;
jpgoptions.format = SaveDocumentType.JPEG; // Document Type
doc.exportDocument(File(dest),ExportType.SAVEFORWEB,jpgoptions);
}

 

TOPICS
Actions and scripting

Views

528

Likes

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

Community Expert , Nov 14, 2022 Nov 14, 2022

Yes, it is, but not using the standard DOM code:

 

https://theiviaxx.github.io/photoshop-docs/Photoshop/ExportOptionsSaveForWeb.html

 

You can either resize before export and close the original without saving... Or you can use the ScriptingListener plugin to record AM code for the export – including the resize (note the resize is recorded as a % value, not a px value).

 

Likes

Translate

Translate
Community Expert ,
Nov 14, 2022 Nov 14, 2022

Copy link to clipboard

Copied

Yes, it is, but not using the standard DOM code:

 

https://theiviaxx.github.io/photoshop-docs/Photoshop/ExportOptionsSaveForWeb.html

 

You can either resize before export and close the original without saving... Or you can use the ScriptingListener plugin to record AM code for the export – including the resize (note the resize is recorded as a % value, not a px value).

 

Likes

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
Contributor ,
Nov 14, 2022 Nov 14, 2022

Copy link to clipboard

Copied

Resizing doc to 1200 pt before save for web works fine, thank you!

Likes

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 Expert ,
Nov 14, 2022 Nov 14, 2022

Copy link to clipboard

Copied

LATEST

You're welcome (I'll mark it as the correct answer for you).

Likes

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