Hi, does anyone know how to align text to the center in CS4. Its really bugging me!
Cheers
Align text CS4
Moderator: Paul Tuersley
-
- Posts: 704
- Joined: June 5th, 2004, 7:59 am
- Location: London, UK
In CS4 you can now do this:
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
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);
}
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
-
- 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
viewtopic.php?f=11&t=885
viewtopic.php?t=150
viewtopic.php?f=6&t=931