Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Question about creating a script for AE

  • Question about creating a script for AE

    Posted by Tord-Øystein Stubberud on January 4, 2023 at 11:13 pm

    Hello, I was trying to write a small script for After Effects that includes a textbox. My code looks as follows:

    var expText = SubGroup.add(‘edittext {properties: {name: “expText”, multiline: true, scrollable: true}}’);

    expText.text = “Title”;

    expText.preferredSize.width = 236;

    expText.preferredSize.height = 80;

    Right now my textbox is showing up correctly in the script, but the box where you write the text has a standard white background that contrasts badly with the dark grey interface look that After Effects has. I was wondering how I can make the white background dark, so that it looks a bit better. I found this screenshot somewhere online that shows a textbox with a much darker background and with white text. Any tips?

     

    Tord-Øystein Stubberud replied 1 year, 5 months ago 2 Members · 4 Replies
  • 4 Replies
  • Dan Ebberts

    January 4, 2023 at 11:52 pm

    To do that, I think you need to use the ScriptUIGraphics object to define a brush and apply it to the control’s background color. The Adobe JavaScript Tools Guide has some good info and examples. Search for “backgroundColor”.

  • Tord-Øystein Stubberud

    January 8, 2023 at 12:12 am

    Thank you so much for the reply! I have checked different places and searchjed for ScriptUIGraphics and backgroundColor, and tried different examples from the web, but none seem to work. My textbox still looks like the added screenshot no matter what… If anyone could give an example of how to add this to the code that would be fantastic 🙂

  • Dan Ebberts

    January 8, 2023 at 1:13 am

    I just tried it and had no real luck with the background color. If I use a fill brush of the desired color, I can get a colored box around the text entry area, but that the closest I can get. Maybe somebody with more experience in this area will chime in…

  • Tord-Øystein Stubberud

    January 10, 2023 at 2:34 pm

    thanks 🙂 Hopefully someone has an answer!

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy