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

•  Select a text by its name and change its size (in points) — Scripting

Engaged ,
Apr 22, 2024 Apr 22, 2024

Copy link to clipboard

Copied

Hello -

 

I try to make a small script to

Select a item by its name and after that

to change its size to a specific size (in points).

 

the name odf the items is "WeightSansProNormal" (as you can see in the attached screenshot)

But can't make it work 😞

 

Any help would be appreciate.

Thank you, enjoy your day.

 

 

#target illustrator

app.activeDocument.selection = null;         // Ensure there is nothing in the document selected already. This way you only get the selection you want.  

var thisDoc = app.activeDocument;
var myText = thisDoc.pageItems.getByName('WeightSansProNormal');
myText.textRange.characterAttributes.size = 16.6;

 

 

 

- Dimitri

TOPICS
Scripting

Views

118

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 3 Correct answers

Community Expert , Apr 22, 2024 Apr 22, 2024

Your code works for me as well without problems.

 

Do you get an error message? Or what is the problem?

Votes

Translate

Translate
Community Expert , Apr 22, 2024 Apr 22, 2024

the script should work, unless you have extra spaces in the Text Frame's name

Votes

Translate

Translate
Engaged , Apr 24, 2024 Apr 24, 2024

Hello - 

 

I dunno why,

but I turn off/on my computer and it works now  …

 

Thank sfor your feedbacks.

Enjoy your day.

 

- Dimitri

 

 

Votes

Translate

Translate
Adobe
Community Expert ,
Apr 22, 2024 Apr 22, 2024

Copy link to clipboard

Copied

Your code works for me as well without problems.

 

Do you get an error message? Or what is the problem?

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
Community Expert ,
Apr 22, 2024 Apr 22, 2024

Copy link to clipboard

Copied

the script should work, unless you have extra spaces in the Text Frame's name

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
Engaged ,
Apr 24, 2024 Apr 24, 2024

Copy link to clipboard

Copied

LATEST

Hello - 

 

I dunno why,

but I turn off/on my computer and it works now  …

 

Thank sfor your feedbacks.

Enjoy your day.

 

- Dimitri

 

 

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