2 Replies Latest reply on Aug 7, 2014 12:25 AM by Bob Haslett

    Change a font using extendscript in illustrator

    Bob Haslett

      I have a script that loops through text items on an illustrator page and when it encounters one of a certain size it changes it to a different point size. I would also like to alter the font. The code I have is

       

           if (roundedSize== 7.2) {

                      item.textRange.characterAttributes.size=9.6;

                      $.writeln(item.textRange.characterAttributes.textFont)

                      item.textRange.characterAttributes.textFont="Metric-Semibold"

                      };

       

      It work fine without the fourth line, but as soon as I try and set a typeface the loop bails. Could someone tell me what I am doing wrong here

       

      Many thanks