characterStyle won't apply to textRange
I have the following code:
changeLayer.textFrames.getByName(textKeys
var legalStyle = doc.characterStyles.add("legal");
var charAtts = legalStyle.characterAttributes;
charAtts.leading=6;
charAtts.size=20;
legalStyle.applyTo(changeLayer.textFrames.getByName(textKeys
Which is pretty much identical to the example (page 24) in the javaScripting reference for AI CS3 (what I'm using). However, the style isn't taking effect. No errors, no notifications, just no change in the text. Any idea what I'm doing wrong? Thanks.