Can someone help on this?
This is the script I use to save my photos after processing. It works very well, but it is a one shot script.
If I modify the photo after having saved it, the script won’t save the photo a second time.
So, what did I miss or did wrong?
const fileToken = async (format) => {
var saveFolder = await require("uxp").storage.localFileSystem.getFolder();
var saveFile = await saveFolder.createFile(`${docNameNoExt}.tif`);
var saveFileToken = await require("uxp").storage.localFileSystem.createSessionToken(saveFile);
await saveTIF(saveFileToken);
async function saveTIF(fileToken){
await batchPlay(
[
{
"_obj": "save",
"as": {
"_obj": "TIFF",
"byteOrder": {
"_enum": "platform",
"_value": "IBMPC"
},
"LZWCompression": true,
"saveTransparency": true,
"layerCompression": {
"_enum": "encoding",
"_value": "RLE"
}
},
"in": {
"_path": fileToken,
"_kind": "local"
},
"copy": false,
"documentID": docId,
"lowerCase": true,
"saveStage": {
"_enum": "saveStageType",
"_value": "saveBegin"
},
"_isCommand": true,
"_options": {
"dialogOptions": "display"
}
},
{
"_obj": "save",
"as": {
"_obj": "TIFF",
"byteOrder": {
"_enum": "platform",
"_value": "IBMPC"
}
},
"in": {
"_path": tifFileToken,
"_kind": "local"
},
"documentID": docId,
"lowerCase": true,
"saveStage": {
"_enum": "saveStageType",
"_value": "saveSucceeded"
},
"_isCommand": false,
"_options": {
"dialogOptions": "display"
}
}
],{
"synchronousExecution": false,
"modalBehavior": "fail"
});
}
}