One of the features of my plugin is the ability to open a Windows Explorer or Finder window in a given location. This is used to show the source file location for a Photoshop layer.
This was done using “require(“uxp”).shell.openExternal”, which could take simple Windows file paths or the URI equivalent prefixed by “file://” when using macOS.
This was the code used so far which worked on 22.4 and prior:
/* layerFilePath example on Windows: "D:\Work\png_v001" */
const operatingSystemStart = require("os").platform().substring(0, 3);
if (operatingSystemStart == "win") {
await require("uxp").shell.openExternal(layerFilePath);
} else {
await require("uxp").shell.openExternal("file://" + encodeURI(layerFilePath));
}
On 22.5 it seems like shell.openExternal no longer supports local paths, and gives the following error message in the console: “file scheme is not supported”.
Does anyone know if there’s a way around this? It would be great if I could resolve this ASAP. Thank you
Mine was API version 1. I’ve just tried changing the manifest to API version 2 which has introduced some new issues, but I’m sure I can iron them out. Will respond here once plugin is updated to API 2. Thanks for the reply
Looks like this was introduced as part of an improved API (openPath) that hasn’t quite made it to release. The gating in this API didn’t quite align with the release of the newer API that was designed for opening Finder/Folder windows.
I’ll see if we can get it fixed for Ps 22.5.1 (September release).