0 Replies Latest reply on Dec 26, 2015 7:33 AM by Colin Flashman

    How to stop a script once it gets going

    Colin Flashman Adobe Community Professional

      Hello everybody.

       

      I have created a script that features a progress bar for the benefit of the user. It is effectively the same one as featured in Peter Kahrel's "scripting UI 2.8 guide. Unfortunately, once the script gets going, there's no ability for the user to hit a cancel button, nor is there the ability to hit the esc key, nor command+. either. Not so bad if the script went for a moment... but when it could potentially go for hours, there needs to be the ability to pull the plug earlier.

       

      I've searched high and low on the forums and am no better off. I found this thread that suggested that Esc should stop ANY script: https://forums.adobe.com/thread/714517?tstart=0

       

      Unfortunately in my case, it doesn't... it keeps charging on like a runaway train. Another poster had a similar experience: https://forums.adobe.com/message/5820802#5820802

       

      In this last post I could find, there was a solution to add a Cancel dialog... but it may as well have been there for decoration, because no matter how many times I clicked on it, no go: https://forums.adobe.com/message/1107611#1107611

       

      My script can have interruptions in it, and in fact does if it detects missing fonts (it displays a confirm dialog to keep going or stop there and then).

       

      Short of putting a line of text asking users to force-quit ID in case they want to cancel (that's akin to asking drivers who want to stop their car to stick their feet out, flintstones style), I'm not sure what to do. I'm open to suggestions.