Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
1

New Text Box Options Available in Scripting

Adobe Employee ,
Feb 07, 2024 Feb 07, 2024

Hello everyone,

With After Effects (Beta) build 24.3.0.20 and later, there are now several new scripting attributes available for Box Text layers. These new attributes—listed below—control how and where your text is arranged and aligned inside of its box, and are not currently available in the UI.

We need your feedback on how these new options might be put to use in your projects and where you would expect them to be found in the interface of After Effects. For those of you familiar with Illustrator, most of these new attributes are equivalent to the Offset and Align options found in the Area Type Options dialog.

The new attributes for Box Text are:

  1. Vertical Alignment — The existing default value is always Top, but in Beta, you can now use TextDocument.boxVerticalAlignment to set the alignment to Center, Bottom, or Justify. Justify will equally space out the lines in the vertical space of the text box.

  2. First Baseline — This controls the distance between the top of the text box and the baseline of the first line of text, available as TextDocument.boxFirstBaselineAlignment. The existing default value is Ascent, based on the height of the characters, but now there are many others available (e.g. x-height and em box) with unique use cases depending on the combined font metrics on the line.

  3. First Baseline Minimum — Related to the previous attribute, TextDocument.boxFirstBaselineAlignmentMinimum allows you to explicitly set the distance from the top of the text box to the baseline of the first line of text, rather than rely on measurements from the characters.

  4. Inset SpacingTextDocument.boxInsetSpacing allows you to effectively set a padding value for the text box, ensuring all of the text stays a certain distance from the box boundary as it wraps inside the box.

  5. Auto Fit ModeTextDocument.boxAutoFitPolicy enables the height of the text box to be driven by the text itself, rather than cutting off the text if it goes beyond the defined bottom of the text box. It is equivalent to the "Auto Size" checkbox available in Illustrator’s Area Type Options.

  6. Overflow — This last TextDocument.boxOverflow attribute is read-only, but allows you to use scripting to check whether any Text layer has text being cut off by going outside the box.


Full details for these attributes in scripting are available in the latest scripting documentation at https://ae-scripting.docsforadobe.dev/introduction/changelog.html. As usual, these new APIs remain subject to change while they are still in Beta.

To try out these attributes without needing to write your own script, download and run the attached sample .jsx scriptUI panel* and run it from File > Scripts > Run Script File... You should see a panel that allows you to try out these attributes on your own Text layers. You can also view and download the script at https://github.com/AdobeDocs/after-effects/blob/main/samples/ComposeBoxTextOptions_ScriptUISample.js....

JohnColombo_0-1707342923824.png

 

*The attached file has the extension .jsx.txt because the forums do not support .jsx attachments. You will need to remove the .txt extension to run the script in AE, or download the .jsx directly from the GitHub link.

 

Thank you for taking the time to give feedback and for helping us improve After Effects,

– Douglas, John, and Sebastien

TOPICS
Feedback
1.8K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Feb 08, 2024 Feb 08, 2024

Thank you for adding in these features, they are great!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 29, 2025 May 29, 2025

This is great! Now we just need these controls natively in AE.
Variable fonts would be a great next step.

Thanks a lot

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 29, 2025 May 29, 2025

HI @JohnColombo , these are fantastic changes! Love 'em.

Is there a plan to make these available in the UI? For example, will alignment now include vertical alignment?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Sep 09, 2025 Sep 09, 2025

Hi @Ron Ganbar,

Thanks for your patience. There aren't yet any plans to make these available in the UI, but I will consider this a request for adding it 🙂

 

Cheers,

- John, After Effects Engineering Team  

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 11, 2025 Sep 11, 2025
LATEST

Is there a particular reason these won't be made available in the UI? It would bring AE to parity with Illustrator regarding text alignment.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Sep 08, 2025 Sep 08, 2025

Ooh @JohnColombo  I've only just found this!
Am I right in assuming that these text box options are only accessible via scripting and not via expressions?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Sep 09, 2025 Sep 09, 2025

Hi @hellopaul4,

Yes, that's correct. These are only available via ExtendScript scripting and not in either of the expression engines.

 

Cheers,

- John, After Effects Engineering Team  

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines