Subject:"Cancel" button
Posted by: bejj
Date:8/30/2013 11:23:18 AM
I have a long .cs script that will run during 1 hour. I have no feature to stop / cancel the script : I have to quit SF10 if I want to stop... Is there a way for adding a "CANCEL" button (in the status bar) like in all SF Tools ? or Is there a way for adding a keyboard shortcut to stop a script ? (like CTRL C) Thanks in advance. |
Subject:RE: "Cancel" button
Reply by: roblesinge
Date:8/30/2013 1:12:41 PM
The short answer is, "maybe." Post your code and perhaps I can help. Rob. |
Subject:RE: "Cancel" button
Reply by: bejj
Date:8/30/2013 1:55:45 PM
Hello, Thank you for your answer. As I work with 5000 wav files, I would like to be able to stop the script at any time. (Either with CTRL+C or with a "Cancel" button in the status like in all SF effect tools) Here is the code :
|
Subject:RE: "Cancel" button
Reply by: roblesinge
Date:8/30/2013 5:00:39 PM
This isn't as optimized as it could be, but here is what I came up with. You basically have to roll your own GUI to get buttons that can stop the script. So, when you fire it off, you'll have to hit the "Start Script" button for it to run. Then you should be able to hit the "Stop Script" button and it *should* stop. I can't fully test this to your circumstances since I don't have your files. So, maybe try it out on a smaller test batch of files, but obviously large enough to allow you time to hit the stop button. I added a progress bar just to give you a visual sense of how much further you have to go. You could also implement a label to give you an exact file count. Let me know if this doesn't work. Like I said, it's untested.
|
Subject:RE: "Cancel" button
Reply by: bejj
Date:8/31/2013 3:30:38 AM
Hi roblesinge, Thanks a lot. In the meantime, I have added some WaitForSuccessorCancel() everywhere and now I often have some Cancel button, so it is enough for my needs now. But I will try your nice solution as well! Thanks a lot. |