• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers

all open document layer Spesefic Layer Name search And Select Layer Stop The Script

Contributor ,
Jun 20, 2022 Jun 20, 2022

Copy link to clipboard

Copied


if (app.documents.length) {


if (!confirm("", false)) {

throw null;
}

var actDoc = app.activeDocument;


for (var i = 0; i < app.documents.length; i++) {
app.activeDocument = app.documents[i];


sTT = stringIDToTypeID; lrs = [].slice.call(activeDocument.artLayers), ref = new ActionReference()
while(lrs.length) {/^HFrame|HFrame|h$/i.test((shft = lrs.shift()).name) && ref.putIdentifier(sTT('layer'), shft.id)}
(dsc = new ActionDescriptor()).putReference(sTT('null'), ref), executeAction(sTT('select'), dsc)
}

app.activeDocument = actDoc;

app.beep();
alert("HFrame|HFrame This Layer name Selecte")

} else {
alert('You must have a document open!');
}

Views

113

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 20, 2022 Jun 20, 2022

Copy link to clipboard

Copied

Please let us know which program you are having problems with. Someone will be along to move this post to the appropriate product forum, where you are more likely to get an answer to your question. It would also help if you actually told us what your question is. 🙂

The Using the Community forum is for help in using the Adobe Support Community forums, not for help with specific programs, installation issues, or account issues such as subscription questions or billing problems, or generalized questions about Creative Cloud services.

* Product questions should be posted in the associated product community.
* Installation questions should be posted in the Download & Install community.
* Account issues, including subscription questions or billing problems, should be posted in the Account, Payment, & Plan community.
* Questions about the Creative Cloud desktop app or general questions about apps in the Creative Cloud should be posted to the Creative Cloud Services community.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jun 20, 2022 Jun 20, 2022

Copy link to clipboard

Copied

Sorry sr

all open document Spesefic Layer Name search And Select Layer Stop The Script

From all the documents opened in
Photoshop under the name of Layer, I want to search for my favorite document.

name of Layer, I want to search for my favorite document.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Aug 29, 2022 Aug 29, 2022

Copy link to clipboard

Copied

LATEST

This script is not working properly

Yes, this script searches for documents by layer name. Yes it works perfectly if only 2 documents are open.

This script does not work properly if more than 2 documents are open in Photoshop

If there are too many documents open, Photoshop crashes

////////////////////////////////////////////////////////////////////////////////////////////////////////////////


var doc = app.activeDocument;
var find;
var i;
var ii;
var layer;
loop1:
if (app.documents.length) {
for (i = 0; i < app.documents.length; i++) {
doc = app.documents[i];
for (i = 0; i < doc.layers.length; i++) {
app.activeDocument = doc;
app.activeLayer = doc.layers[i];
for (i = 0; i < doc.artLayers.length; i++) {
find = "HFrame_" + (i + 1);
for (ii = 0; ii < doc.artLayers.length; ii++) {
if (doc.artLayers[ii].name == find) {
layer = doc.artLayers[ii];
break loop1;
}
}
}
}
}
}


if (!layer) {

alert("Layer not found");
} else {
doc.activeLayer = layer;
selectLayer(layer.id);
// ...


}

function selectLayer(id) {

var desc1 = new ActionDescriptor();
var ref1 = new ActionReference();
if (id.constructor.name == "String") {
ref1.putName(charIDToTypeID('Lyr '), id);
} else {
ref1.putIdentifier(charIDToTypeID('Lyr '), id);
}
desc1.putReference(charIDToTypeID('null'), ref1);
desc1.putBoolean(charIDToTypeID('MkVs'), false);
executeAction(charIDToTypeID('slct'), desc1, DialogModes.NO);
}

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines