Justification attribute to center text in Illustrator API
Why do Justification to aiCenter and Align Center produce different results?
Set myFrame = textGroup.TextFrames.Add
myFrame.TextRange.CharacterAttributes.Size = defaultFontSize
myFrame.TextRange.CharacterAttributes.TextFont = appRef.TextFonts.Item(nameOfFont)
myFrame.Contents = myLabel
myFrame.Paragraphs(1).ParagraphAttributes.Justification = 2 ' aiCenter
myFrame.Position = Array(myXPos, myYPos)
...the lines of text are not centered with respect to each other.
Using Windows 10 Enterprise, and Illustrator 26.5.2.
"Given myLabel string with at least one line break character in it, when I use VBscript code like this..."
"Is there a way, using the VBscript API, to achieve text-centering of multiple lines in a text frame? If not, I'd like to request a new paragraph attribute to the VBscript API to accomplish this function.
Related to this bug:
Justification bug, cannot set 'center' in v24.2 using AppleScript
We're using this script to create dozens of figures. For those that require text centering, we must open the (otherwise) finished figure, and center the text.
While that's not time-consuming, there's always a chance that an instance will be missed, and the figure might be published with misaligned text.