Copy link to clipboard
Copied
Hi Folks,
Is there any possibilities to close dialog box programmatically without click button.
Sample code:
Copy link to clipboard
Copied
Hi @Jothi Sankar Anand S can you give us a bit more idea of what you want to achieve? You sample code already shows how to programmatically close the dialog:
dlg.close();
You don't have to put that in the button's onClick event. You can use it anywhere that you have a valid reference to a visible dialog window.
What did you have in mind?
- Mark
Copy link to clipboard
Copied
I'm expecting to close without click event dlg.close(); this one within the onClick event so its not closing automattically like after 3 second
Copy link to clipboard
Copied
A silly example:
var dlg = new Window('dialog', 'Custom Dialog');
dlg.add('statictext', undefined, 'Type "close" to finish!');
var field = dlg.add('edittext {text:"open", alignment:["fill","center"]}');
field.onChanging = function () {
if ('close' === this.text)
dlg.close();
}
dlg.show();
Copy link to clipboard
Copied
HI @m1b
Actually dont touch any button or anything to close modal. It will close after some time like 3 sec or anything.
Copy link to clipboard
Copied
Ah, I see. I'm pretty sure ScriptUI doesn't allow for anything like that. It only spawns mouse and keyboard events, not time events. Sorry.
Copy link to clipboard
Copied
Thanks for the update @m1b
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more