text frame properties

Hi, I am new to illustrator and do not know about its tools' name. So, I want to change these attributes(underlined in red color shown in the picture) through ExtendScripting. Just let me know their abbreviation of VA, AA, etc or their functions in Extendscript.

  • 1
    Hover your mouse over these icons, and the name will be displayed.
    – Billy Kerr
    Nov 25 '20 at 11:22
  • Textframe has no attributes for text the text inside the text frame has a textRange and the range has a style or character attribute attached to it
    – joojaa
    Nov 25 '20 at 11:22
  • Some resources: AI JS object model chart, Adobe Illustrator CS6 Type Library JS: Application (you can go up or down the object tree by following the links on the page), TextRange, CharacterAttributes, Working With Text Ranges
    – Joonas
    Nov 25 '20 at 13:26
  • 1
    But for example, this would change the leading and tracking of the first textframe in the active document: var charAttr = app.activeDocument.textFrames[0].textRange.characterAttributes; charAttr.autoLeading = false; charAttr.leading = 70; charAttr.tracking = 200;
    – Joonas
    Nov 25 '20 at 13:29
  • 1
    I remembered internet archive is a thing, so here's that link.
    – Joonas
    Sep 5 at 9:22

To build @Joonas' comment into an answer, these two attributes are called (top to bottom) Leading and Tracking. As @Billy Kerr mentioned you can find these names by hovering over the icons. In ExtendScript their names are - reassuringly - leading and tracking.

Here's example of them in action taken from the CS4 Scripting Guide (page 84, 86).

// Create & Get Text Object
var myDocument = app.documents.item(0);
var myPage = myDocument.pages.item(0);
var myTextFrame = myPage.textFrames.add();
myTextFrame.contents = "x";
var myTextObject = myTextFrame.parentStory.characters.item(0);

// Set Leading and Tracking
myTextObject.leading = 12;
myTextObject.tracking = 0;

I find the scripting guide can be quite useful. I'm new to ExtendScript and one method I've found is to search for the attribute name in the Scripting Guide, find examples of the attributes being used, and build my code from those examples.

  • Thank you for your kind answer!
    – dextoruz
    Sep 23 at 18:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.