I have a program where the user may hit Stop and stop the program while running at any given time.
I'm looking for a way to detect if the user hits the Stop button in Script Editor (producing the -128 "User canceled" error), so I can do a little cleanup before the program closes.
Is there a way to do this?
Best Answer
You can use a try block like this: