Edit Mode Script Run
Moderators: Dorian (MJT support), JRL
Edit Mode Script Run
How do I stop a running script when in edit mode Shift-ESC does not work
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Re: Edit Mode Script Run
Works for me in edit mode. Also CTRL+F2 which you will see is the shortcut for "Stop Debug" under the Debug menu. The editor would have to be active for that. Then you can also hit the Stop button. But SHIFT+ESC is global. And works for me while in Edit mode. Which version are you on?
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
Re: Edit Mode Script Run
One caveate to this is that the script may not stop if it is stuck in a function call. For example if you're running a particularly intense VBScript or if you have a DBQuery> to a large data table, the script won't stop while running that process. If your intense function takes 60 seconds, and you have that intense function in a loop, you might have a millisecond long window every 60 seconds in which to press shift+esc and stop the script.
I try to always build in a Quit subroutine tied to the Esc key in a key_down OnEvent>. Place this code at the top of your script. When you need to stop, press the esc key.
The shift+exc combination is passed to the script and closes the script immediately. If the script doesn't close, shift+exc has to be pressed again since it acts on the script at the moment it is pressed. On the other hand, the OnEvent key press is built into the script, so pressing the esc key once is "remembered" because the Quit subroutine is inserted into the script's process sequence.
Bear in mind that if the script is busy running a particular function, the script will not quit until the function completes. If the function is in an infinite loop your only choice will be to start Task Manager and kill "msched.exe". If you do this you will lose any unsaved changes to your script.
I try to always build in a Quit subroutine tied to the Esc key in a key_down OnEvent>. Place this code at the top of your script. When you need to stop, press the esc key.
Code: Select all
OnEvent>key_down,VK27,0,Quit
SRT>Quit
Exit>0
END>Quit
Bear in mind that if the script is busy running a particular function, the script will not quit until the function completes. If the function is in an infinite loop your only choice will be to start Task Manager and kill "msched.exe". If you do this you will lose any unsaved changes to your script.