• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
1

How can I check the name of a figure in a script?

Engaged ,
May 02, 2024 May 02, 2024

Copy link to clipboard

Copied

The scene contains two shapes: a rectangle and an ellipse.
The rectangle shape has been renamed to "Rectangle".
The ellipse shape has not been renamed and is named "<Ellipse>".
Using a script I want to rename the ellipse to "Circle"
for this in the script

 

var aiDocument = app.documents[0];
var carentLayer = aiDocument.layers[0];

I'm using...

 

if (carentLayer.pathItems[k].name == undefined){
   carentLayer.pathItems[k].name =  "Circle";
}


but such a check does not lead to success.

 

How can I check the name of a figure in a script?

TOPICS
Scripting

Views

72

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Guide , May 02, 2024 May 02, 2024

Unnamed items are an empty string (""), not undefined.  

Votes

Translate

Translate
Adobe
Guide ,
May 02, 2024 May 02, 2024

Copy link to clipboard

Copied

LATEST

Unnamed items are an empty string (""), not undefined.  

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines