Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Scripting: Update text fields, sliders, checkbox, etc. from pop-out script panel

  • Scripting: Update text fields, sliders, checkbox, etc. from pop-out script panel

    Posted by Paul Connors on September 18, 2019 at 1:25 pm

    Hello. I’m trying to connect the elements of a standalone ScriptUI pop-out that I’m building using a WYSIWYG builder (P9UI) to that corresponding layers within a “Controller” precomp. Basically, I’ve create a “Controller” composition that has a whole bunch of text layers, sliders, check boxes, etc. that control all the layers (nested in precomps) that create the full-length of my MASTER composition. I’d love to be able to use the pop-out UI via scripting that would control all these elements rather than having to go into the “Controller” composition and update each layer individually.

    I explored doing this via the Essential Graphics panel, but the amount of layers within the Controller comp make the Essential Graphics panel way, way too long. Using the Script WYSIWYG builder I’m able to organize everything into a much easier to see / use space.

    So, here goes … Here is the current code that makes up the UI for the controller script I’m building:


    win=new Window("window","new project",[0,0,500,500],{resizeable:true,independent:false,minimizeButton:false,maximizeButton:false,});
    panel_1=win.add("panel",[5,5,965,545]);
    textBox_1_header=panel_1.add("statictext",[10,5,80,25] ,"Text Box 1",{multiline:true});
    textBox_1=panel_1.add("edittext",[5,25,75,45] ,"Enter Text 1",{readonly:0,noecho:0,borderless:0,multiline:0,enterKeySignalsOnChange:0});
    template_Header=panel_1.add("statictext",[10,55,120,75] ,"Template Selection",{multiline:true});
    checkbox_Header=panel_1.add("statictext",[10,105,120,125] ,"Checkbox Selection",{multiline:true});
    group_1=panel_1.add("group",[5,125,115,170],"undefined");
    group_1.graphics.backgroundColor = group_1.graphics.newBrush (group_1.graphics.BrushType.SOLID_COLOR,[0.25,0.25,0.25]);
    row_1_boxHigh=group_1.add("checkbox",[5,5,115,25],"Row 1");
    row_1_boxHigh.value=0
    row_2_boxHigh=group_1.add("checkbox",[5,25,115,45],"Row 2");
    row_2_boxHigh.value=0
    number_Header=panel_1.add("statictext",[10,180,120,200] ,"Number Selection",{multiline:true});
    color1_Header=panel_1.add("statictext",[10,230,120,250] ,"Color Selection",{multiline:true});
    colorInput_1=panel_1.add("edittext",[5,250,75,270] ,"ffffff",{readonly:0,noecho:0,borderless:0,multiline:0,enterKeySignalsOnChange:0});
    template_Select=panel_1.add("dropdownlist",[5,75,105,97] ,["1","2"]);
    number_Select=panel_1.add("dropdownlist",[5,200,105,222] ,["1","2","3","4","5"]);
    win.center();
    win.show();

    And here is what I have in terms of corresponding compositions and elements:

    • A precomp named “Script Connection Test”
    • A null named: “Controller Null” which contains the following:
    — A slider named: “Template Selection”
    — A checkbox named: “Row 1”
    — A checkbox named: “Row 2”
    — A slider named: “Number Selection”
    • A text layer named “textBox_1”
    • A text layer named “colorInput_1”

    Would anyone be able to give me a crash course on how to edit the code in my script to connect to my layers to make the updates?

    Any help would be greatly appreciated.

    Thank you!

    Paul Connors replied 6 years, 7 months ago 2 Members · 2 Replies
  • 2 Replies
  • Walter Soyka

    September 19, 2019 at 2:23 am

    You’d need to implement a couple of buttons — one to get values from the current time and stuff them into the script’s controls, and another to use the values from the script’s controls to set values for the actual properties at the current time.

    When you read the values, you can just modify the controls, like this:
    row_1_boxHigh.value=1;
    textBox_1.text = "New text string";

    You’d use setValueAtTime() to write those values into properties.

    But that said, I do think that Essential Graphics is a nice way to go. You can add Groups to manage longer lists, if that helps.

    Walter Soyka
    Designer & Mad Scientist at Keen Live [link]
    Motion Graphics, Widescreen Events, Presentation Design, and Consulting
    @keenlive   |   RenderBreak [blog]   |   Profile [LinkedIn]

  • Paul Connors

    September 19, 2019 at 1:58 pm

    Hi Walter. Thanks very much for your insight. In the interest of learning something new I’m going to do some digging on the manual-type instructions you provided, but in the meantime, how do you set up groups in Essential Graphics? Is that a CC 2019 feature? I can’t seem to see it in CC 2018. Thank you!

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