get layer name
Hello, how should I write a script to get the name of 'object_1'?
app.activeDocument.activeLayer.layers[0].layer(2).name
I couldn't retrieve them with this syntax.

Hello, how should I write a script to get the name of 'object_1'?
app.activeDocument.activeLayer.layers[0].layer(2).name
I couldn't retrieve them with this syntax.

please check the object hierarchy again.
mySubLayer has 3 objects and they are pageItems, not subLayers.
Currently, "object_1" is selected and the active layer is "mySubLayer".
Therefore, to access the "name" property of "object_1" from this state, do the following
//activeLayer as "mySubLayer" not "myLayer"
alert(app.activeDocument.activeLayer.pageItems[0].name)
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.