3 Replies Latest reply on Jan 12, 2014 7:07 PM by CarlosCanto

    Setting character attributes on a range of characters at once

    osato_reg Level 1

      Illustrator Version CS3-CC

      Preferred scripting: Visual Basic (VBScript)


      In the Adobe Illustrator CS5 Scripting Reference (VBScript), I see the following code for setting character attributes.


      iCount = textRef.Characters.Count

      i = 1

      Dim charRef

      Do While (i < (iCount + 1))

      dSize = dSize * 1.1

      textRef.TextRange.Characters(i).CharacterAttributes.HorizontalScale = dSize

      textRef.TextRange.Characters(i).CharacterAttributes.VerticalScale = dSize

      i = i + 1



      Is there a way to set character attributes on a range of characters at once?


      Iterating through the characters one by one is really slow, especially in higher versions of Illustrator (like CS6).


      I want to be able to set character attributes, for example, from the third character to the sixth character of a paragraph textrange.


      Basically, I want to do something like itembyrange in InDesign scripting.


      Thank you.

      Tak Osato