Home  >  Article  >  Web Front-end  >  How to batch modify layer names in PS using JS_javascript skills

How to batch modify layer names in PS using JS_javascript skills

WBOY
WBOYOriginal
2016-05-16 17:02:171489browse
Copy code The code is as follows:

#target photoshopapp.bringToFront();
if (documents. length == 0) {
alert("No document to process");
} 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 < layers.length; i ) {
var tempName = "name" i;//Modified name
layers[i] .name = tempName;
}
}

}

Save the above code as a .jsx file and run it as a script in ps.

can only support all layer modes and does not work on groups.
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn