Hi, I’m trying to use the fs.getFileForSaving() but it doesn’t work!
I’m on win 10 here the sample code:
var fs = require("uxp").storage.localFileSystem;
...
const [file] = await fs.getFileForSaving({ types: [ "txt" ]});
if (!file) {
return;
}
await file.write("It was a dark and stormy night");
Here the console log errors:
Plugin TypeError: a.lastIndexOf is not a function
at b.<anonymous> (uxp://uxp-internal/home/ubuntu/jenkins/workspace/Torq/torq-native/torq-2.1-xd-13.0/build/modules_gen/webfs/src/js/webfs_scripts.js:134:2139)
at new Promise (<anonymous>)
at b.value (uxp://uxp-internal/home/ubuntu/jenkins/workspace/Torq/torq-native/torq-2.1-xd-13.0/build/modules_gen/webfs/src/js/webfs_scripts.js:134:1868)
at b.<anonymous> (uxp://uxp-internal/home/ubuntu/jenkins/workspace/Torq/torq-native/torq-2.1-xd-13.0/build/modules_gen/webfs/src/js/webfs_scripts.js:138:1937)
at new Promise (<anonymous>)
at b.value (uxp://uxp-internal/home/ubuntu/jenkins/workspace/Torq/torq-native/torq-2.1-xd-13.0/build/modules_gen/webfs/src/js/webfs_scripts.js:138:1753)
at blueRectangle (\main.js:41:29)
at Object.execScenegraphEdit (plugins/ScenegraphGuard.js:1:2219)
at BaseCommand._invokePluginCommand [as _commandFn] (plugins/PluginLoader.js:1:2980)
at BaseCommand.execute (lib/BaseCommand.js:1:929)
I just copied and pasted the sample code from the official doc.
UPDATE: it doesn’t work either on mac os…