終了

get layer name

エクスプローラー ,
Apr 14, 2024 Apr 14, 2024

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.

shusaku_tr_0-1713101089260.pngexpand image

 

キーワード
Win , スクリプティング
331
翻訳
レポート
コミュニティガイドライン
他のユーザーへの思いやりを持ち、敬意を払いましょう。コンテンツの出典を明記し、投稿する前に内容が重複していないか検索してください。 さらに詳しく
community guidelines

correct answers 1 件の正解

Community Expert , Apr 14, 2024 Apr 14, 2024

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)

 

 

翻訳
Community Expert ,
Apr 14, 2024 Apr 14, 2024
最新

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)

 

 

翻訳
レポート
コミュニティガイドライン
他のユーザーへの思いやりを持ち、敬意を払いましょう。コンテンツの出典を明記し、投稿する前に内容が重複していないか検索してください。 さらに詳しく
community guidelines