Copy link to clipboard
Copied
Hi,
with jsx script, how do I access first object in layer named "Artwork".
Something like:
var doc = app.activeDocument;
var item = doc.layers['Artwork'];
item.pageItem[0].visible = false;
but thats not it obviously
[ title changed by moderator ]
Hi,
It should be pageItems instead of pageItem in the following line
item.pageItem[0].visible = false;
Another question, what do you mean by first Item, is it one visible at the top inside the layer or at the bottom?
Secondly, visible is not the property to change teh visiblity. Property name is hidden.
So try following snippet to hide the first item
var doc = app.activeDocument;
var item = doc.layers['Artwork'];
item.pageItems[0].hidden = true;
Try:
var doc = app.activeDocument;
var aLay = doc.layers['Artwork'];
aLay.pageItems[0].hidden = true;
But I would use pathItems[0] instead.
Copy link to clipboard
Copied
sorry about the misleading title, I forgot to change it
Copy link to clipboard
Copied
Hi,
It should be pageItems instead of pageItem in the following line
item.pageItem[0].visible = false;
Another question, what do you mean by first Item, is it one visible at the top inside the layer or at the bottom?
Secondly, visible is not the property to change teh visiblity. Property name is hidden.
So try following snippet to hide the first item
var doc = app.activeDocument;
var item = doc.layers['Artwork'];
item.pageItems[0].hidden = true;
Copy link to clipboard
Copied
Try:
var doc = app.activeDocument;
var aLay = doc.layers['Artwork'];
aLay.pageItems[0].hidden = true;
But I would use pathItems[0] instead.
Copy link to clipboard
Copied
two souls - one thought
😉
Copy link to clipboard
Copied
At the top inside the layer.
Thank you, it works
Have a nice day