Testing for the user cancelling a dialog
Hi there, please can someone help me with a question about the user cancelling a dialog?
I have a js process that works ok.
What I'm having a problem with is the user cancelling a dialog.
var exitDialog = 0;
while (exitDialog !=999)
{
var cRtn = app.response("How many checkboxes would you like (1-9) ?");
if (cRtn > 0 && cRtn < 10)
{
var exitDialog = 999;
}
else
{
if (cRtn == null) {break;}
app.alert('Please enter a value from 1-9');
}
}
// the rest of the process happens here and that works ok.I can run the code above and it works fine apart from if the user cancels the dialog.
If I run the code above in the debugger it works ok. When I load it as a custom menu item it still works ok until the user cancels.
What I'm trying to do is allow the user to cancel the operation by pressing the 'Cancel' button on the dialog.
Please can someone point me in the right direction?
Thank you 🙂
