Hello! It’s my first post on the forums.
I’m working on a plugin that should copy several files from the plugin folder to the user-selected folder.
The problem is that I get this error:
Plugin Error: copyEntry: failed to copy file
at Object._copyFileEntry (uxp://uxp-internal/webfs_scripts.js:2:66158)
But… the file is actually copied to the selected location. The problem is that since the error is thrown the plugin doesn’t execute the code that comes after the file copy.
const fs = require("uxp").storage.localFileSystem;
async function testFiles(selection) {
const folder = await fs.getFolder();
const pluginFolder = await fs.getPluginFolder();
const testFile = await pluginFolder.getEntry('testfile.txt');
await testFile.copyTo(folder, {overwrite:true});
console.log("complete");
}
module.exports = {
commands: {
testFiles: testFiles
}
};
I’m working on Mac with the latest XD versions installed.
Any help would be much appreciated.