How to abort a method on the custom dialog?

Hi all,

How do you abort a method using the custom dialog? For instance, using the default template, the “cancel” button acts the same as the “ok” button in which the method proceed regardless if you clicked the “cancel” or “ok” button. Tried looking it up in the user manual and Help Topics but to no avail. Below is a screenshot of what I mean. Any help is appreciated.

The “Close/return” field set as “(2) Cancel” needs to be handled in the script,

after the “custom dialog” code, you will need to incorporate an If-Then group to handle the “(2) Cancel” response,

image

i added an example here to force script to abort if the dialog returns the “cancel” selection

1 Like

The usage of the If-Then group makes sense for telling the script to abort upon the “(2) Cancel” response but my next question is how do I initialize the left operand variable, in your example, “rtnDialog”, in the button within the custom dialog?

create a “new variable”

then in custom dialog script line, set the “return” variable for dialog box to be “rtndialog”

Ah I see now. That answered my question. Thank you so much for the help, greatly appreciated!