Copy link to clipboard
Copied
What is the easiest way to find an anchored object within the document. I this case I would like to find OB2 (the cyan square ) and hide it.
If you know an easy way of doing this I would be grateful for your help. I am using jsx.
Thank you : )
Geza
Hi,
Try this:
var myItems = app.activeDocument.allPageItems, I = myItems.length;
while (I--) if (myItems.name == "OB2") myItems.visible = false;
(^/)
Copy link to clipboard
Copied
Hi,
Try this!!
app.activeDocument.layers.itemByName("OB2").visible=false;
Thanks
Copy link to clipboard
Copied
Hi,
Thank you for this but it only works if the layer is on the very top of the hierarchy.
So in this case
app.activeDocument.layers.itemByName("OB2").visible=false;
Will fail. Because for me app.activeDocument.layers.itemByName("OB2") returns an inValid layer.
This would work
app.activeDocument.layers.itemByName("Layer 1").visible=false;
Because Layer 1 is on the very top.
So is there any way to find the OB1 or OB2. Or maybe I am doing something wrong ? : )
Thank you,
Geza
Copy link to clipboard
Copied
Hi,
Try this:
var myItems = app.activeDocument.allPageItems, I = myItems.length;
while (I--) if (myItems.name == "OB2") myItems.visible = false;
(^/)
Copy link to clipboard
Copied
Many Thanks! You saved me a lot of time.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now