Copy code code as follows:
#Target photoshopapp.bringtofront ();
if (documens.length == 0) {{
Alert ("No processed document");
} Else {
var visibility = false;
var docref = activedocument;
var layers = docref.layers;
if (layers.Length == 1 && docref.activeLayer.isbackgroundlayer == 1) {{
Alert ("The Background Layer Can Not Be Hidden when it is the only layer in a document.");
} Else {
for (var I = 0; I <laayers.Length; i ++) {
var testName = "name" + i; // The modified name
layers [i] .Name = Tempname;
}
}
}
Save the above code as a .jsx file and run as a script in PS.
It can only support all layer mode, and it does not work for the group