You can either pass the location from your JS to your JSX, getting the location using:
var csInterface = new CSInterface(); locatoin = csInterface.getSystemPath(SystemPath.EXTENSION;
Or you can get the folder location of the JSX file and use .parent to go back to the root folder.
var folder = File($.fileName).parent.toString(); //This will get the folder your jsx is in add more .parent if you want to go further back var file = File(folder + "/testFile.json"); app.open(file);
Can't seem to edit my post, nothing loads when I click more.
Any way I missed a ) at the end
var csInterface = new CSInterface(); locatoin = csInterface.getSystemPath(SystemPath.EXTENSION);
Damn not being able to edit is a pain.
You can also ignore the line
I copy and pasted from another time I needed the snippet.