In the code example below, testFile
successfully opens (although an error “cannot coerce result into action descriptor” is caught), but foundFile
does not.
Why not? And if this is the case how am I supposed to get a valid reference to a file when I need to filter? Am I supposed to go:
- getEntries()
- filter getEntries result
- getEntry() with the result from getEntries
const jpegs = await jpegQualityFolder.getEntries();
const foundFile = await jpegs.filter(entry => entry.name.indexOf(shotId) !== -1);
const testFile = await jpegQualityFolder.getEntry("<FILENAME.jpg>")
openDocument(foundFile);
const openDocument = async (file) => {
try {
await core.executeAsModal(() => app.open(file));
} catch (error) {
alert(error);
}
};