Hello,
I have the action for isolating a layer (option+clicking the eyeball so it’s the only visible layer), which is:
{
"_obj": "show",
"null": [{
"_ref": "layer",
"_enum": "ordinal",
"_value": "targetEnum"
}]
}
However, how do I test whether the document is already in an isolate state before toggling it?
would I have to count the layers manually, like…
const app = require('photoshop').app;
let layerVisible = 0;
app.activeDocument.layers.forEach((layer) => layerVisible += layer.visible);
// or something??
The issue is that simply having one visible layer does not constitute photoshop recognizing the document as being in an isolated visibility state. For now, I’m just going to count the layers and toggle an isolate state if more than one layer is detected.
I just don’t know if there’s a better way I can check for this.