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

Save for Web Metadata Scripting

Engaged ,
Apr 07, 2019 Apr 07, 2019

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
1.7K
Translate
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

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

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

Translate
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

Oh ok thank you.

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

Translate
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

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

Translate
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
LATEST

it works perfectly

using ScriptListener isn't all bad

Translate
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