Unable to write to text file inside plugin folder

async function writeFile() {
   try {
      let myFolder = await require('uxp').storage.localFileSystem.getPluginFolder()
      let newFile = await myFolder.createFile("textFile.txt", { overwrite: true });
      await newFile.write("It was a dark and stormy night."); 
   } catch (error) {

console.log(newFile.mode) outputs


yet I get the following error:

Error: The file uses a storage provider that is read-only.

Plugin folder, as stated in the docs, is read-only. I believe you should use data folder. At least I don’t have any issues when using getDataFolder()

1 Like

you’re right, I actually missed that. thank you!