Here’s the code I use to save a Photoshop document as a JPEG, using a variable that contains the JPEG quality save settings:
const result = await app.batchPlay([
{
"_obj": "save",
"as": {
"_obj": "JPEG",
"options": {
"extendedQuality": image_save_quality,
}
},
"in": {
"_path": outputFileToken,
"_kind": "local"
},
"documentID": app.activeDocument._id,
"copy": true, // required to ensure it saves as JPEG; without this, it saves as .psd;
"overwrite": true,
"_isCommand": true,
"_options": {
"dialogOptions": "dontDisplay"
}
}
], {
"synchronousExecution": true,
"modalBehavior": "fail"
});
console.log(result);
} catch (error) {
console.error("Error:", error);
}
}
The variable values are correct, as I confirm by console logging its values. However when I console log the return object of this command? It always shows “extendedQuality = 11”, no matter what I set it to in the code. Why does this happen?
Is there some other setting I have marked in there that overrides the specified quality settings to default it back to 11?
Thanks