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

Save for Web Metadata Scripting

Engaged ,
Apr 07, 2019 Apr 07, 2019

Copy link to clipboard

Copied

Hello everyone,

I have this script to save for web (for JPG)

I want to add in my script the line where I can choose the different Metadata options (there are 5 options).

If it can be done without ScriptListener it's even better.

here is my script:

var Name = app.activeDocument.name;

if (Name.indexOf(".") != -1 ) Name=Name.substr(0,Name.lastIndexOf("."));

filePath = app.activeDocument.path + '/' + Name + '.jpg';                    //filePath has also the name in it and also the extension

var options = new ExportOptionsSaveForWeb();

options.quality = 50;

options.format = SaveDocumentType.JPEG;

options.optimized = true;

var doc = app.activeDocument

doc.exportDocument(File(filePath),ExportType.SAVEFORWEB,options);

TOPICS
Actions and scripting

Views

1.6K

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 , Apr 07, 2019 Apr 07, 2019

No, you could search the forums...

Here is a screenshot comparing ALL metadata to NO metadata, with differences highlighted. I have not tried plugging the code in or running it through Clean SL first, so more lines of code than the two shown below may be required.

SL.png

EDIT: Try these –

Include Metadata in Save for Web JPEGS

Re: Setting SaveForWeb Metadata option

Votes

Translate

Translate
Adobe
Community Expert ,
Apr 07, 2019 Apr 07, 2019

Copy link to clipboard

Copied

AFAIK this is one of the black holes in DOM code, so script listener is the only option that I am aware of.

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
Engaged ,
Apr 07, 2019 Apr 07, 2019

Copy link to clipboard

Copied

Oh ok thank you.

Do you have by chance an already made ScriptListener lines so i can add to my script?

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 Expert ,
Apr 07, 2019 Apr 07, 2019

Copy link to clipboard

Copied

No, you could search the forums...

Here is a screenshot comparing ALL metadata to NO metadata, with differences highlighted. I have not tried plugging the code in or running it through Clean SL first, so more lines of code than the two shown below may be required.

SL.png

EDIT: Try these –

Include Metadata in Save for Web JPEGS

Re: Setting SaveForWeb Metadata option

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
Engaged ,
Apr 07, 2019 Apr 07, 2019

Copy link to clipboard

Copied

LATEST

it works perfectly

using ScriptListener isn't all bad

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