I’m trying out the new getEntryWithUrl()
method and I’m not having much luck. I’ve included fs.readdir()
to test the path is working. readdir
returns the folder contents fine, but getEntryWithUrl
throws its toys out of the pram with the same path. I also included the example from the documentation for accessing the plugin data folder and it returns the same error.
Anyone got this to work yet that can provide some pointers? Or alternatively, is getEntryWithUrl
pre-release?
PS: 24.2.0
API: 2
Manifest: 5 (fullAccess
granted)
const { app } = require("photoshop");
const fs = require("fs");
const fsp = require("uxp").storage.FileSystemProvider;
// Get path to activeDocument folder
const doc = app.activeDocument;
const path = doc.path.slice(0, doc.path.lastIndexOf("\\"));
console.log("paths", path);
// Read contents of activeDocument folder
const readPathFolder = await fs.readdir(`file:/${path}`);
console.log("folders", readPathFolder);
// Get entry with url ???
const dataFolder = await fsp.getEntryWithUrl(`plugin-data:/`);
const pathFolder = await fsp.getEntryWithUrl(`file:/${path}`);
console.log("entries", { dataFolder, pathFolder });