Persisten token folder

I have this script that makes me select a folder and creates a persistent token, so far so good,

In the panel I’m creating I want to create 3 buttons
button one that saves in the jpg folder,
button two that saves to the tif folder
three button that saves to png folder

my problem is this
once the folder has been selected, the jpg, tif, png files are all saved in the same folder,

so I should have 3 different persistent tokens

How can you change that each token selects a different folder?

This is the starting script

var myFolder = await require("uxp").storage.localFileSystem.getFolder();
let token = await require("uxp").storage.localFileSystem.createPersistentToken(myFolder);
localStorage.setItem("persistent-token", token);

Change the first argument to a variable - currently you are overwriting the same local storage item called “persistent-token”

1 Like

Timothy Optimal Thank you.

1 Like