Align text CS4

Find out why the . goes before the /

Moderator: Paul Tuersley

Post Reply
spewperb
Posts: 4
Joined: November 7th, 2008, 2:18 am

Hi, does anyone know how to align text to the center in CS4. Its really bugging me!

Cheers
Paul Tuersley
Posts: 704
Joined: June 5th, 2004, 7:59 am
Location: London, UK

In CS4 you can now do this:

Code: Select all

{
	// select a text layer before running this script
	
	// grab active comp
	var activeItem = app.project.activeItem;
	
	// grab sourceText "value" from selected layer
	var theValue = activeItem.selectedLayers[0].sourceText.value;
	
	// change the value's justification
	theValue.justification = ParagraphJustification.CENTER_JUSTIFY;
	
	// apply the value back on to the text layer
	activeItem.selectedLayers[0].sourceText.setValue(theValue);
}
The full range of options are:
ParagraphJustification.LEFT_JUSTIFY
ParagraphJustification.RIGHT_JUSTIFY
ParagraphJustification.CENTER_JUSTIFY
ParagraphJustification.FULL_JUSTIFY_LASTLINE_LEFT
ParagraphJustification.FULL_JUSTIFY_LASTLINE_RIGHT
ParagraphJustification.FULL_JUSTIFY_LASTLINE_CENTER
ParagraphJustification.FULL_JUSTIFY_LASTLINE_FULL
maxfects
Posts: 2
Joined: September 22nd, 2009, 8:53 am

how is this done is CS3?
Paul Tuersley
Posts: 704
Joined: June 5th, 2004, 7:59 am
Location: London, UK

It isn't easy doing it in CS3 as it doesn't have access to the text alignment options. Here are some existing threads discussing the workarounds needed to find the dimensions of a text layer:
viewtopic.php?f=11&t=885
viewtopic.php?t=150
viewtopic.php?f=6&t=931
Post Reply