View Full Version : Adobe Illustrator JavaScript problem

10-07-2009, 04:35 PM

I'm writing a web app to generate labels using user submitted data with Adobe Illustrator. I am editing the contents on a text frame in Illustrator using a JavaScript file.

My method is as follows:

changeLayer = doc.layers.getByName(textKeys[t]);
changeLayer.textFrames.getByName(textKeys[t]).contents = textArray[textKeys[t]];

Basically, I set wrapInside to true and then I replace the contents of the Text Frame with a String.

However, rather than wrapping the text as desired, Illustrator prints it all on one line and expands the size of the Text Frame (and Layer) to fit the text on one line. Even when I explicitly set the width and height of the frame in the script, it just shrinks the text to fit on one line in the frame, rather than wrapping it. If I explicitly set the font size it then expands the frame again, but only on one line. Any ideas?? Thanks in advance.