property names are a mess, for my case I used known value in the properties I want to be dynamic and looked for that value and replaced it with my own variables.
async function quickExport(folder, filename, quality) {
await executeAsModal(async () => {
let command = { "_obj": "export", "using": { "$DIDr": true, "$EICC": false, "$Mtt": false, "$MttB": 255, "$MttG": 255, "$MttR": 255, "$Op": { "_enum": "$SWOp", "_value": "$OpSa" }, "$Pass": 1, "$QCUI": 0, "$QChS": 0, "$QChT": false, "$QChV": false, "$SHTM": false, "$SImg": true, "$SWch": { "_enum": "$STch", "_value": "$CHsR" }, "$SWmd": { "_enum": "$STmd", "_value": "$MDCC" }, "$SWsl": { "_enum": "$STsl", "_value": "$SLAl" }, "$obCS": { "_enum": "$STcs", "_value": "$CS01" }, "$obIA": false, "$obIP": "", "$ohAA": true, "$ohAC": { "_enum": "$SToc", "_value": "$OC03" }, "$ohCA": false, "$ohEn": { "_enum": "$STen", "_value": "$EN00" }, "$ohIC": true, "$ohIZ": true, "$ohIn": -1, "$ohLE": { "_enum": "$STle", "_value": "$LE03" }, "$ohQA": true, "$ohTC": { "_enum": "$SToc", "_value": "$OC03" }, "$ohXH": false, "$olCS": false, "$olEC": { "_enum": "$STst", "_value": "$ST00" }, "$olNC": [{ "$ncTp": { "_enum": "$STnc", "_value": "$NC00" }, "_obj": "$SCnc" }, { "$ncTp": { "_enum": "$STnc", "_value": "$NC19" }, "_obj": "$SCnc" }, { "$ncTp": { "_enum": "$STnc", "_value": "$NC28" }, "_obj": "$SCnc" }, { "$ncTp": { "_enum": "$STnc", "_value": "$NC24" }, "_obj": "$SCnc" }, { "$ncTp": { "_enum": "$STnc", "_value": "$NC24" }, "_obj": "$SCnc" }, { "$ncTp": { "_enum": "$STnc", "_value": "$NC24" }, "_obj": "$SCnc" }], "$olSH": { "_enum": "$STsp", "_value": "$SP04" }, "$olSV": { "_enum": "$STsp", "_value": "$SP04" }, "$olWH": { "_enum": "$STwh", "_value": "$WH01" }, "$ovCB": true, "$ovCM": false, "$ovCU": true, "$ovCW": true, "$ovFN": filename, "$ovNC": [{ "$ncTp": { "_enum": "$STnc", "_value": "$NC01" }, "_obj": "$SCnc" }, { "$ncTp": { "_enum": "$STnc", "_value": "$NC20" }, "_obj": "$SCnc" }, { "$ncTp": { "_enum": "$STnc", "_value": "$NC02" }, "_obj": "$SCnc" }, { "$ncTp": { "_enum": "$STnc", "_value": "$NC19" }, "_obj": "$SCnc" }, { "$ncTp": { "_enum": "$STnc", "_value": "$NC06" }, "_obj": "$SCnc" }, { "$ncTp": { "_enum": "$STnc", "_value": "$NC24" }, "_obj": "$SCnc" }, { "$ncTp": { "_enum": "$STnc", "_value": "$NC24" }, "_obj": "$SCnc" }, { "$ncTp": { "_enum": "$STnc", "_value": "$NC24" }, "_obj": "$SCnc" }, { "$ncTp": { "_enum": "$STnc", "_value": "$NC22" }, "_obj": "$SCnc" }], "$ovSF": true, "$ovSN": "images", "_obj": "SaveForWeb", "blur": 0.0, "format": { "_enum": "$IRFm", "_value": "JPEG" }, "in": { "_kind": "local", "_path": folder }, "interfaceIconFrameDimmed": false, "optimized": true, "quality": quality } };
result = await batchPlay([command], {});
}, { "commandName": "Exporting..." });
}
the example above exports JPG using a token, filename and quality