Forums › Adobe After Effects Expressions › Question about creating a script for AE
-
Question about creating a script for AE
Tord-Øystein Stubberud updated 2 months, 2 weeks ago 2 Members · 5 Posts
-
Tord-Øystein Stubberud
January 4, 2023 at 11:13 pmHello, 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?
-
Dan Ebberts
January 4, 2023 at 11:52 pmTo 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 amThank 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 amI 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…
Log in to reply.