Skip to main content
automatizer
Participant
July 27, 2011
Question

Script to make texts bold or italic

  • July 27, 2011
  • 1 reply
  • 1060 views

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?

This topic has been closed for replies.

1 reply

CarlosCanto
Community Expert
Community Expert
July 27, 2011
automatizer
Participant
July 27, 2011

Your hyperlink really reminds me of where I actually quoted the script in my question. Upon careful rereading this time, I catch the point of semi-automatic solution. Thank you and your hyperlink.