Hey,
I think that a script that can toggle on/off the visibility of all layers may be the solution for this prob.
Hey,
I think that a script that can toggle on/off the visibility of all layers may be the solution for this prob.
By @H_Gu
I started work on this before @jazz-y posted his script, so it may not be necessary.
/*
Toggle Layer Visibility for All Top-Root level layers.jsx
v1.0 - 16th July 2025, Stephen Marsh
https://community.adobe.com/t5/photoshop-ecosystem-discussions/show-only-layer-inside-layer-type-mode/td-p/15413523
*/
#target photoshop
var doc = app.activeDocument;
var desktopPath = Folder.desktop.fsName;
var stateFile = new File(desktopPath + "/layer_visibility_state_log.json");
if (stateFile.exists) {
loadVisibilityStates(doc.layers);
} else {
saveVisibilityStates(doc.layers);
}
///// Helper Functions /////
function saveVisibilityStates(layers) {
var states = [];
for (var i = 0; i < layers.length; i++) {
states.push(layers[i].visible);
layers[i].visible = false;
}
var json = "[" + states.join(",") + "]";
stateFile.open("w");
stateFile.write(json);
stateFile.close();
}
function loadVisibilityStates(layers) {
if (!stateFile.exists) {
alert("No saved state found. Run the script once to save visibility.");
return;
}
stateFile.open("r");
var jsonString = stateFile.read();
stateFile.close();
var states;
try {
states = eval(jsonString);
} catch (e) {
alert("Failed to parse saved state.");
return;
}
for (var i = 0; i < layers.length && i < states.length; i++) {
try {
layers[i].visible = states[i];
} catch (e) {
continue;
}
}
stateFile.remove(); // Remove the log file after the second run
}
Once installed in the Presets/Scripts folder and Photoshop restarted, you can assign a custom keyboard shortcut to the script.
https://prepression.blogspot.com/2017/11/downloading-and-installing-adobe-scripts.html