I have a script for a "prompt" filter-based Query Builder. As soon as I run the script, a Query Prompts Window will appear (that's what is wished), but if I click the CANCEL button, it continues running the script which consequently brings to unnecessary data processing.
My initial thought was that the OnRunCanceled() option would catch this condition. However, it currently is only called when the user clicks Cancel on the progress dialog. (I have submitted this item to the development team for consideration in a future release of JMP.)
In the meantime, you can check the result that is returned by the query. For example if you have stored your query in a variable, you could do something like the following to stop the script execution:
status = query << Run Foreground;
If( Is Empty( status ), Stop() );
Print( "next" );