You need to use the Get ( LastMessageChoice ) Function, and you can use this within an If statement to control the script based on the results.
The result will return a number, 1 - 3, based on the choice. The default is 1 then Button 2 and then button 3.
You script might look like this
Show Custom Dialog [ Message ; Default = "OK" Button 2 = "Cancel" ]
If [ Get ( LastMessageChoice ) = 2 ]
End IfGo to Layout [ Ok Layout ]
This script will stop the script running if the user clicks on the Cancel button, otherwise run the rest of the script.
If you use all three buttons you could then use the Else and Else If steps to control different actions after the dialog.
I hope this helps
I'm still having a bit of trouble. When I'm editing the calculation, the note at the bottom of the window says the result must be Boolean (non-zero values are true, zero and empty values are false). What can I change to allow my If function to accept numeric values? Also, in your example, the End If script line is indented like the Halt Script line. When I set mine up, it is not (and apparently cannot be) indented.
I assume it is the If step you are seeing this message. Input the calculation as below:
Get ( LastMessageChoice ) = 2
This will return a result of 1 if the user clicks the second button, which will give a result of True for this If step and then run the Halt step, Any other button on the dialog will return 0 and will then skip the Halt step. Does this make sense?
The indentation is simply the formatting of the post going wrong and I could not fix it quickly so I gave up, the way you see it in the script editor is correct.
That's the way I had it, but since I pasted your version over my own, it seems to be working. Thank you!
No worries, glad to help.