Copy link to clipboard
Copied
When the user clicks the OS-specific close icon in the title
bar of my interface he has the choice of not closing it so he can do something else he forgot to do.
My script works fine in Extend Script, but in After Effects 2019( v.17.0.0) it disables the close button after the onClose event returns false for the first time. Must I create a specific close button to do this?
This is the code:
var dlg = new Window('window', 'Close Test', undefined);
var pn = dlg.add('panel');
pn.add('statictext', [0,0,60,20], 'LINE 1');
pn.add('statictext', [0,0,60,20], 'LINE 2');
dlg.onClose = function()
{
if (Window.confirm('Do you really wanna close?', true, 'CLOSE UI'))
{
return true;
}
else
{
return false;
}
}dlg.show()
Copy link to clipboard
Copied
I think after one of the releases, the .onClose() event actually never get fired anymore. I'm not even sure you can close a ScriptUI panel via a button ā I know you can assign buttons to close modal dialogs spawned from a ScriptUI panel, but not sure if its possible to close the panel itself.
Copy link to clipboard
Copied
The onClose event is fired (as you would be able to see by runing my short code). The problem is that after it returns false for the first time the close button becomes inactive.