Script to make texts bold or italic
I saw someone suggested the following code to meet the need:
var app = new Illustrator.Application();
var doc = app.ActiveDocument;
var bold = doc.CharacterStyles["Bold"];
var italic = doc.CharacterStyles["Italics"];
var frame = doc.TextFrames[0];
bold.ApplyTo(frame);
italic.ApplyTo(frame);
But it does work in my case since "doc.CharacterStyles["Bold"];" and "doc.CharacterStyles["Italics"]" declare an error message of "No such element". Is there another way that I can try to make texts bold or italic?
