Copy link to clipboard
Copied
In Illustrator we have the option to vertically align text via Area Type, which is a great addition. However, I would like to use this feature through scripting. Can anyone tell me if this is available (cannot find it in the docs) and if so, how to use it? I'd imagine it to look something like this:
textRef.AreaType = Align.CENTER
2 Correct answers
I don't think this is possible in the way you want. Unfortunately, with scripts we don't have access to the alignment options for text frames.
Text Align Center can be recorded, so do that, then have your script run the Action (or use standalone)
Explore related tutorials & articles
Copy link to clipboard
Copied
This works for both point and area text:
// select textFramevar text1 = app.selection[0];text1.textRange.paragraphAttributes.justification = Justification.CENTER;
Edit: I misread what you wrote.
Copy link to clipboard
Copied
I don't think this is possible in the way you want. Unfortunately, with scripts we don't have access to the alignment options for text frames.
Copy link to clipboard
Copied
Is that it?
app.selection[0].textRange.characterAttributes.alignment = StyleRunAlignmentType.center;
Copy link to clipboard
Copied
Unfortunately this doesn't vertically align the text
Copy link to clipboard
Copied
Text Align Center can be recorded, so do that, then have your script run the Action (or use standalone)

