Answered
In a script, how do you apply a character style to a TextItem?
I have a valid CharacterStyle, but I can't find the property in a TextFrameItem to apply it to. I've tried applying it to the TextFrameItem, its contents, and its characters properties, and the script quits in all cases.
I can't find any example online, either. Any insight appreciated.
style = sourceDoc.characterStyles.getByName("AValidStyle);
if (!style)
// couldn't find style in sourceDoc
continue;
// create a temporary page item
var tempTextItem = activeDocument.textFrames.add();
tempTextItem.contents = "1";
style.applyTo(tempTextItem.contents); // NOPE
