Skip to main content
2 of 2
deleted 23 characters in body; edited tags
Welz
  • 10k
  • 10
  • 48
  • 83

Adobe Illustrator Script Adjustment

I'm working a script to make ALL the texts of a document with some specifics. Glad to say it's already functioning but not completely because it's just working on some of the textframes and not all of them.

The intention is to make the changes on every texts on the active document (point, area, frames, etc) and unfortunately, even when it works on some text frame, not all characters are affected because some special ones like - or + don't get the properties of the other normal characters.

Made some research and do believe I should be working with parentStory maybe? But I didn't figure out how to implement.

Here is my code:

    var document = app.activeDocument;  
    var allTexts = document.textFrames[0];  

    for (i=0; i<allTexts.words.length; i++) {  
        allTexts.words[i].characterAttributes.autoLeading = true;
        allTexts.words[i].characterAttributes.tracking = 250;
        allTexts.words[i].characterAttributes.kerningMethod = AutoKernType.AUTO;
        allTexts.words[i].characterAttributes.underline = false;
        allTexts.words[i].characterAttributes.strikeThrough = false;
        allTexts.words[i].characterAttributes.capitalization = FontCapsOption.NORMALCAPS;
        allTexts.words[i].characterAttributes.language = LanguageType.UKENGLISH;
        allTexts.words[i].characterAttributes.horizontalScale = 100;
        allTexts.words[i].characterAttributes.verticalScale = 100;
        allTexts.words[i].characterAttributes.baselineShift = 0;
        allTexts.words[i].characterAttributes.rotation = 0;             
        allTexts.words[i].characterAttributes.baselinePosition = FontBaselineOption.NORMALBASELINE;
        allTexts.words[i].characterAttributes.baselineDirection = BaselineDirectionType.Standard;
        allTexts.words[i].characterAttributes.alternateGlyphs = AlternateGlyphsForm.DEFAULTFORM;
        allTexts.words[i].characterAttributes.antialias = TextAntialias.SHARP;
 }