Can't set where my JSON file gets written to.
daveronan
Apr 23 2019 | 2:27 pm
Hi Max community,
I want to specify the directory where my json gets saved to, but it keeps saving the file in the application directory. I want it to save it in a folder below where the patch is saved. Below is the code I'm currently using. Can anyone help
f = new File("DrumClipData.json", "write", "TEXT"); if (f.isopen) { post("writing string to file: " + f.filename + "in: " + f.foldername + "\n"); f.writestring(JSON.stringify({data: retClips})); //writes a string f.close(); } else { post("could not create file: " + f.filename + "in: " + f.foldername + "\n"); }