Forum Replies Created

Page 2 of 5
  • Well here is my Panel Code, and i have problems to run the URL script so where i put that code???? Can you help me please?, and why if i call a variable from the panel group doesnt work like the Window functions??. Windows and Panels doesnt work with the same script structure…

    //Explorer Voraz Button
    var winBrowserCmd = "C:/Program Files/Internet Explorer/iexplore.exe";
    var macBrowserCmdStart = "osascript -e 'open location \"";
    var macBrowserCmdEnd = "\"'";

    {
    function myScript(thisObj){
    function myScript_buildUI(thisObj){
    var myPanel = (thisObj instanceof Panel) ? thisObj : new Window("palette","My Window name",undefined,{resizable:true});

    res = "group{orientation:'row',\
    groupTwo: Group{orientation:'column',\
    myIconButton: IconButton{text:'IconButton', image:'~/Desktop/LogoC5Ctrl.png'},\
    myStaticText: StaticText{text:'Este es mi texto /n dfgdf'},\
    },\
    groupOne: Panel{text:'Master', orientation:'column',alignment:['fill','fill'],alignChildren:['fill','fill'],\
    myCheckbox: Checkbox{text:'My Checkbox'},\
    myDropDownList: DropDownList{properties:{items:['Amarillo','Morado','LightBlue','MidBlue']}},\
    },\
    }";

    myPanel.grp = myPanel.add(res);

    //Defaults
    myPanel.grp.groupOne.myDropDownList.selection = 0

    myPanel.grp.groupTwo.myIconButton.onClick = LinkToURL;

    myPanel.layout.layout(true);

    return myPanel;

    }

    function LinkToURL()
    {
    //Action to link Voraz OnClick
    BtnURL.onClick = LinkToURL;

    function LinkToURL()
    {
    var URL = "https://www.estudiovoraz.com"; // your web page
    if ($.os.indexOf("Windows") != -1)
    system.callSystem(winBrowserCmd + " " + URL);
    else
    system.callSystem(macBrowserCmdStart + URL + macBrowserCmdEnd);

    }

    }

    var myScriptPal = myScript_buildUI(thisObj);

    if((myScriptPal != null) && (myScriptPal instanceof Window)){
    myScriptPal.center();
    myScriptPal.show();
    }

    }

    myScript(this);
    }

  • Thank you, really cool.

  • Hey Dan, thank you for all, i actually got it with this code:
    But do you know how to link the checkbox with an effect checkbox????

    //Creating My Window
    var myWin = new Window (“palette”,”Canal 5 Controles”,undefined,{resizeable: false , maximizeButton: false});
    myWin.orientation = “row”;

    var groupOne = myWin.add(“panel”,undefined,”MasterControles”);
    groupOne.orientation = “column”;
    groupOne.add (“iconbutton”,undefined,”~/Desktop/LogoC5Ctrl.png”,”https://www.google.com”)
    groupOne.add(“statictext”,undefined,”Primer Grupo”)
    var dd = groupOne.add(“dropdownlist”,undefined,[“OFF”,”Amarillo”,”Rojo”]);
    dd.selection = 0;
    groupOne.add(“checkbox”,undefined,”Caritas”);
    groupOne.add(“checkbox”,undefined,”Iconos”);

    dd.onChange = updateProject;
    //Action of my DropDownMenu
    function updateProject(){
    var dropSelection = dd.selection.text;

    switch (dropSelection){
    case “OFF”:
    // do stuff for dropdown named “dd1”
    alert(“blabla”);
    break;
    case “Amarillo”:
    // do stuff for dropdown named “dd2”
    alert(“jaja”);
    app.project.item(7).layer(“_Control”).property(“Effects”).property(“Control v2”).property(“Color System”).setValue([3]);
    break;
    case “Rojo”:
    // do stuff for dropdown named “dd2”
    alert(“Rojo”);
    app.project.item(7).layer(“_Control”).property(“Effects”).property(“Control v2”).property(“Color System”).setValue([3]);
    break;

    default:
    alert(“default”);
    break;
    }
    }

    myWin.center();
    myWin.show();

  • My Dropdown list is a Pseudo Effect inside a _Control Layer: Somethig like this:

    Layer: _Control
    Effect: Control v2
    Dropdownlist
    ->
    -OFF
    -Amarillo
    -Rojo
    -Morado

    And i want to connect from my Script depending of Selection to the Dropdown list of my Effect. Thats because im calling the app.project.item bla bla bla
    All i want to connect is that dropdown menu to my dropdownlist in my script window.

  • My Dropdown list is a Pseudo Effect inside a _Control Layer: Somethig like this:

    Layer: _Control
    Effect: Control v2
    Dropdownlist -> OFF
    Amarillo
    Rojo
    Morado

    And i want to connect from my Script depending of Selection to the Dropdown list of my Effect. Thats because im calling the app.project.item bla bla bla
    All i want to connect is that dropdown menu to my dropdownlist in my script window.

  • I actually prove it but doesnt work, i dont know if i need something more or less. But how did you do your dropdown list ???

  • Something like this??????:

    //Creating My Window
    var myWin = new Window (“palette”,”Canal 5 Controles”,undefined,{resizeable: false , maximizeButton: false});
    myWin.orientation = “row”;

    var groupOne = myWin.add(“panel”,undefined,”MasterControles”);
    groupOne.orientation = “column”;
    groupOne.add (“iconbutton”,undefined,”~/Desktop/LogoC5Ctrl.png”,”https://www.google.com”)
    groupOne.add(“statictext”,undefined,”Primer Grupo”)
    var dd = groupOne.add(“dropdownlist”,undefined,[“OFF”,”Amarillo”,”Rojo”]);
    dd.selection = 0;
    groupOne.add(“checkbox”,undefined,”Caritas”);
    groupOne.add(“checkbox”,undefined,”Iconos”);

    //Action of my DropDownMenu
    dd.onChange = updateProject;

    function updateProject(){
    switch (this.name){
    case “dd1”:
    // do stuff for dropdown named “dd1”
    selection = 1
    app.project.item(7).layer(“_Control”).property(“Effects”).property(“Control v2”).property(“Color System”).setValue([1]);
    break;
    case “dd2”:
    // do stuff for dropdown named “dd2”
    selection = 2
    app.project.item(7).layer(“_Control”).property(“Effects”).property(“Control v2”).property(“Color System”).setValue([3]);
    break;
    default:
    break;
    }
    }

    myWin.center();
    myWin.show();

  • Sooo can you share me an example for that??? plsssss

  • Ok i got it, but now how can i assign for each dropdown menu list a different Root Object:

    //Creating My Window
    var myWin = new Window (“palette”,”Canal 5 Controles”,undefined);
    myWin.orientation = “row”;

    var groupOne = myWin.add(“panel”,undefined,”MasterControles”);
    groupOne.orientation = “column”;
    groupOne.add (“image”,undefined,”~/Desktop/LogoC5Ctrl.png”)
    groupOne.add(“statictext”,undefined,”Primer Grupo”)
    var dd = groupOne.add(“dropdownlist”,undefined,[“OFF”,”Amarillo”]);
    dd.selection = 0;
    groupOne.add(“checkbox”,undefined,”Caritas”);

    //Action of my DropDownMenu
    dd.onChange = updateProject;

    function updateProject(){
    var lis = dd.selection = 1
    lis = app.project.item(1).layer(“Control”).property(“Effects”).property(“Control”).property(“Color System”).setValue([4]);
    }

    myWin.center();
    myWin.show();

  • Thank you a lot, i will try with that script. Probably i will have another question. So actually i do not close this post.

Page 2 of 5

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