Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Script: Closing $.colorPicker(); also closes the Script UI window (dialog)

  • Script: Closing $.colorPicker(); also closes the Script UI window (dialog)

    Posted by John Gate on March 17, 2019 at 12:58 pm

    Hi there,

    I’m using $.colorPicker(); and whenever i call it i have to show an alert after that to avoid Window(“dialog”) getting closed automatically.

    What should i do?
    Please advise

    var color_decimal = $.colorPicker();
    alert("color changed"); //so it dont auto closes the dialog

    John Gate replied 7 years, 2 months ago 3 Members · 5 Replies
  • 5 Replies
  • Dan Ebberts

    March 17, 2019 at 3:38 pm

    I’ve never had to do anything like that–$.colorPicker() works fine for me. How are you launching your main window?

    Dan

  • John Gate

    March 17, 2019 at 8:02 pm

    Thanks for your reply Dan,

    If you copy paste and run following code, and click button which will show color picker on After Effects (Mac).
    and when you close the picker, it will also auto close the dialog.

    Thanks

    testColorPicker();

    function testColorPicker(){

    var myWindow = new Window("dialog", "Test Color", undefined, {
    resizeable: true
    });

    myWindow.add("button", undefined, "show picker").onClick = function(){

    var color_decimal = $.colorPicker();

    };

    myWindow.show();

    }

  • Dan Ebberts

    March 17, 2019 at 9:54 pm

    When I close the color picker, the window stays open. I’m on Windows though.

    Dan

  • Lars Jandel

    March 17, 2019 at 10:03 pm

    Try this – not on my Mac atm either, but the .update() solved this issue for me in the past:

    testColorPicker();

    function testColorPicker(){
    var myWindow = new Window("dialog", "Test Color", undefined, {resizeable: true});

    myWindow.add("button", undefined, "show picker").onClick = function(){
    var color_decimal = $.colorPicker();
    myWindow.update();
    }

    myWindow.show();
    }

  • John Gate

    March 18, 2019 at 7:21 am

    Thank you guys ☺

    Dan’s revised code solved the solution

    myWindow.update();

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