This content has been marked as final. Show 3 replies
>I want to perform a search in JS but just in one layer of my document.
If you want to perform a search in text frames then you can check itemLayer property.
>is there any method to set a layer in the locked or hidden state?
myLayer.locked = true;
myLayer.visible = false;
Actually I want the search performed in all the document, this way:
app.findGrepPreferences.findWhat = s_regexp;
var myFoundItems = app.documents.item(0).findGrep(true);
What I noticed is that if you have two layers in the document with the same content then myFoundItems contains the same items twice (so the research is performed in both the layers).
Is there any way to set the research just in one layer?
Alternatively I should dynamically set locked all the layers but the one interesetd by the search.
>Is there any way to set the research just in one layer?
I don't think it's possible to do directly.
>Alternatively I should dynamically set locked all the layers but the one interesetd by the search.
That's good idea, just lock temporarily all layers except the active one and perform a search.