Copy link to clipboard
Copied
might be an easy one but I'm stuck here:
I want to select all Objects on one Artboard but only those from one exact Layer.
Details:
Using JavaScript I'm able to select all Objects on a specific Artboard.
Now is it possible to select everything from that Artboard being on specific Layer?
This might be one of many Layers.
Each Layer might contain Objects to be spread all over other Artboards...
Setting:
Multiple Artboards
Multiple Layers
Multiple Objects randomly on Layers/Artboards
Basic Script:
for(var a=0; a<artboardRef.length; a++){
docRef.artboards.setActiveArtboardIndex(a);
docRef.selectObjectsOnActiveArtboard();
}
Thanks
Nils
Copy link to clipboard
Copied
Just setting the desired layer to Isolation mode, then selecting all on active artboard (see Select menu) should work.
Isn't that an option?
Copy link to clipboard
Copied
you could lock or hide all layers (except the one you're interested in selecting) before Selecting all objects on artboard.
or you could select all objects like your current script, then loop through all selected objects, query what layer they belong to and deselect if they're not in the target layer
Copy link to clipboard
Copied
In addition to the two ways @CarlosCanto mentioned, you could select the items on the target layer, then deselect the items not on the target artboard, by comparing the bounds of each selected item with the bounds of the target artboard.