-
Scripting: Update text fields, sliders, checkbox, etc. from pop-out script panel
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!