UXPScript save file error with InDesign Server 2023
I'm running UXPScript over SOAP request with InDesign Server 2023 running locally on my Windows machine. At the moment, UXPScript doesn't support arguments or returns, but it will run UXPScript if you send it in inside the <scriptText> tag like so (outer XML not shown):
<scriptText>
// actual script contents
</scriptText>
According to the documentation, we should have access to a "node-like" fs-module: https://developer.adobe.com/indesign/uxp/reference/uxp-api/reference-js/Modules/FileSystem/. It mentions that you can use "plugin-specific storage schemes" such as "plugin:", "plugin-data:", and "plugin-temp:", as well as a native "file:" scheme. Since I'm not developing a plugin, using a "file:" URI seems like the correct route.
So the file I need to write within a folder that I created and have access to looks something like C:\Users\Me\Documents\temp_working_folder\data.json. So if I translate that to a file URI like the docs suggest, that gives me file:///C:/Users/Me/Documents/temp_working_folder/data.json.
When I try to use fs.writeFile, however, I get the following error:
TypeError: Cannot read properties of undefined (reading '_processWriteOptions')
Has anyone else gotten this error? Or has anyone successfully written data to a file on their file system using the "file:" URI scheme?