Apply Character Style to Content Not Word
I am creating a list of all weights and styles of a font family by script.
The list looks like this:
Arial: Regular | Italic | Bold | Bold Italic |
For every font weight/style there is a character style with the same name.
I try to apply this character style to every term in the list, but if I work with
myFrame.parentStory.lines[1].words[i].appliedCharacterStyle=myStyles[i];it is not working, because some styles have two words (like Bold Italic) and I also want to use the | as seperator...
Is there a better solution to achieve this? here is the for each loop:
for ( var i = 0; i < myStyles.length; i++ ) {
myFrame.insertionPoints[-1].contents=myStyles[i]+" ";
myFrame.parentStory.words[i].appliedCharacterStyle=myStyles[i];
};