I’m trying to figure out how to how to save a file in a given folder, without the folder dialogue popping up each time.
Currently I have a button that lets the user select a folder, and stores it path as a value.
C:\Users\UserName\Desktop\
async function getFolderPath(){
const persistentFolder = await fs.getFolder();
setFilePath(persistentFolder.nativePath)
}
I’m using a function to save a file like below
async function saveFile() {
const folder = await fs.getFolder();
const newFile = await folder.createFile("testFile.tif", { overwrite: true });
const saveFile = await fs.createSessionToken(newFile);
const result = await batchPlay(
[
{
"_obj": "save",
"as":
{
"_obj": "TIFF",
"byteOrder":
{
"_enum": "platform",
"_value": "IBMPC"
},
"layerCompression":
{
"_enum": "encoding",
"_value": "RLE"
}
},
"in": {
"_path": saveFile,
"_kind": "local"
}
}
], {
"synchronousExecution": false,
});
}
Is there a way to set the folder path from that value without bringing up the folder select dialogue each time. Basically bypass the folder selection like it would if you saved it to the data folder with fs.getDataFolder()?
Thanks