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);
1 Correct answer
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.
EDIT: Try these –
Explore related tutorials & articles
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.
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?
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.
EDIT: Try these –
Copy link to clipboard
Copied
it works perfectly
using ScriptListener isn't all bad

