Skip to main content
Inspiring
August 5, 2011
Answered

Changing text alignment to center.

  • August 5, 2011
  • 1 reply
  • 2141 views

Fo some reason, the forum search returns 0 results to me no matter what I enter.  I'm sure this has been asked before, but how to I change the alignment of point text to center?

This topic has been closed for replies.
Correct answer Larry G. Schneider

Even though it's point text it's treated the same as area text. The following works

var docRef = app.activeDocument;

var textRef = docRef.textFrames[0];

//textRef.textRange.characterAttributes.size = 28;

var paraAttr_0 = textRef.paragraphs[0].paragraphAttributes;


paraAttr_0.justification = Justification.CENTER;

1 reply

Larry G. Schneider
Community Expert
Larry G. SchneiderCommunity ExpertCorrect answer
Community Expert
August 5, 2011

Even though it's point text it's treated the same as area text. The following works

var docRef = app.activeDocument;

var textRef = docRef.textFrames[0];

//textRef.textRange.characterAttributes.size = 28;

var paraAttr_0 = textRef.paragraphs[0].paragraphAttributes;


paraAttr_0.justification = Justification.CENTER;

Inspiring
August 5, 2011

Forum searches have been broken for some time this is the best way I've seen posted in the ID scripting forum…

[centre & text] "Illustrator Scripting > Discussions" site:forums.adobe.com/thread/

Just put your search criteria in the brackets n google…