Answered
UXP - Batch export Webp
Im trying to write a script that batch exports(among other things) .webp files.
I know there is a great script by Stephen Marsh but i want to do this in the UXP.
So far I got to the point where im exporting them sucessfuly, but since I use "Save as a Copy" from Alchemist the files all got this annoying "copy" in the end of the name. How do I pass a name in here?:
async function exportWEBP(destinationFolder) {
const result = await batchPlay(
[
{
_obj: "save",
as: {
_obj: "WebPFormat",
compression: {
_enum: "WebPCompression",
_value: "compressionLossless"
},
includeXMPData: false,
includeEXIFData: false,
includePsExtras: false
},
in: {
_path: await tokenify(destinationFolder.nativePath),
_kind: "local"
},
// fileDoNotAppendCopy: true,
documentID: 67,
copy: true,
lowerCase: true,
saveStage: {
_enum: "saveStageType",
_value: "saveSucceeded"
},
_options: {
dialogOptions: "dontDisplay"
}
}
],
{}
);
}
