ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

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

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
John Gate
Script: Closing $.colorPicker(); also closes the Script UI window (dialog)
on Mar 17, 2019 at 12:58:48 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


Return to posts index

Dan Ebberts
Re: Script: Closing $.colorPicker(); also closes the Script UI window (dialog)
on Mar 17, 2019 at 3:38:17 pm

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

Dan



Return to posts index

John Gate
Re: Script: Closing $.colorPicker(); also closes the Script UI window (dialog)
on Mar 17, 2019 at 8:02:38 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();




}


Return to posts index


Dan Ebberts
Re: Script: Closing $.colorPicker(); also closes the Script UI window (dialog)
on Mar 17, 2019 at 9:54:11 pm

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

Dan



Return to posts index

Lars Jandel
Re: Script: Closing $.colorPicker(); also closes the Script UI window (dialog)
on Mar 17, 2019 at 10:03:35 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();
}


Return to posts index

John Gate
Re: Script: Closing $.colorPicker(); also closes the Script UI window (dialog)
on Mar 18, 2019 at 7:21:34 am

Thank you guys ☺

Dan's revised code solved the solution

myWindow.update();


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2019 CreativeCOW.net All Rights Reserved
[TOP]