Cancelling a script from a different script
I created a Progress Bar layout/script and it works fine. Except I want a button on on the layout that allows the user to cancel the script. I don't want them to be able to just press Esc because I can't seem to control where they end up when they do that. I wanted, instead, to turn off User Abort and use a Cancel script to do this, executed with a button press. This way I can control what happens when they cancel.
The script I wrote sets a global variable called $$Cancel to 1 when the user pressed the button, and the script that's running when the Progess Bar is refreshing is written to test for the value of that global variable at the beginning of each loop.
When I do this, however, the hourglass prevents the user from pressing the button. Is there a way around this? Freezing the screen isn't an option, because that will keep the Progress Bar from refreshing.