How to set the fs object with a location

How do can i provide a fs object with the location of a folder?

for instance i want to be able to do this.

const folder = await fs.givePath("~/Desktop/images");
const file = await folder.createFile(“rendition.jpg”, { overwrite: true });

im using fs.getFolder(); but i dont want the user to pick a folder. i want to script the location so that my script can save it automatically.

any information would be useful… im having a hard time reading the documentation and making sense of it

1 Like

The short answer is that it’s (for now) impossible to do this. You can either let the user choose a location or use one of the pre-defined ones (e.g., getDataFolder()). For more details, please see (and maybe vote for) the feature request that’s already open regarding this topic at Get File-Entry without forcing the user to select it via File-Dialog.

1 Like

ill just have the user pick a folder first and then continue my automation from there… it should work for now. but i definitely hope that it gets implemented in the future. I had done some scripting in Adobe PhotoShop and i was able to pick a location with no issues… Adobe XD is promising. I believe it should have this capability

1 Like

Adobe has confirmed that persistent file references are coming–already in PS UXP. So the user will have to pick a folder once, but then you can store that reference somewhere.

2 Likes