Change a font using extendscript in illustrator
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
