Hi, I am developing a MacOS app for the Mac App Store using AppleScript. It was rejected because the Stop button of one of the progress bars did not produce any action when clicked (or, at least it didn't for over 5 minutes). I have a theory for why this happened: The app was in the middle of executing a shell command while the progress bar was showing, so the application was unresponsive and thus not responsive to user clicks. But this doesn't help me solve the issue. If the app is not responsive at that time, how do I make the app close when the "Stop" button is clicked? I want the whole app to close quickly when Stop is pressed.
Another thing that further complicates this issue is that everything is wrapped in try-catch blocks. When a user cancels something in AppleScript (such as by pressing a Stop button in a progress bar), an error is thrown to signal that the script must stop. If the user clicks "Stop" in the middle of a try-catch block, the script will not cancel-it will execute whatever I tell it to do on an error. There are too many try blocks in the app to put in a check for what error occurred in each one.
So, how do I make the script respond quickly and produce the desired action (closing the app) in under 5 minutes?
Another thing that further complicates this issue is that everything is wrapped in try-catch blocks. When a user cancels something in AppleScript (such as by pressing a Stop button in a progress bar), an error is thrown to signal that the script must stop. If the user clicks "Stop" in the middle of a try-catch block, the script will not cancel-it will execute whatever I tell it to do on an error. There are too many try blocks in the app to put in a check for what error occurred in each one.
So, how do I make the script respond quickly and produce the desired action (closing the app) in under 5 minutes?