Cancelling a running script

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
winstein
Pro Scripter
Posts: 84
Joined: Mon Nov 26, 2012 3:44 pm

Cancelling a running script

Post by winstein » Mon Nov 26, 2012 4:01 pm

If I want to cancel the script while in the middle of it, what should I do? I attempted the Shift+Esc code within the script, but no luck, even though the icon mentioned that you could press said key combo to cancel it. What is the best way to do this?

Thanks for reading.
PPQ

idiot
Macro Veteran
Posts: 152
Joined: Thu Mar 01, 2007 9:21 am

Post by idiot » Tue Nov 27, 2012 5:47 am

marcus taught this in the past got code from him before when someone else asked basically your assigning a key to end the macro using vk_keys
the vk115 can be changed to any key you want to use to end it

Code: Select all

OnEvent>KEY_DOWN,VK115,0,Shutdown

SRT>Shutdown
  Goto>end_macro
END>Shutdown

//Right at VERY end of macro put:
Label>end_macro


if idiots rule the world then im the king!!!!
i want a free t-shirt give me all of your rep!!!
please give me pro version of macro scheduler and appnavigator!!!

winstein
Pro Scripter
Posts: 84
Joined: Mon Nov 26, 2012 3:44 pm

Post by winstein » Tue Nov 27, 2012 7:48 am

Thanks for the help, which is always welcomed, but what I was basically asking is to end the script without the need to press anything (the example you gave requires that I need to press something). Also, I checked that using the Goto label is not encouraged, so I used the Skip Label one. Oh well, I guess it's possible to do this without the need to press anything anyway.

However, I suppose this could also help, seeing that it is handy to end the schedule anytime.

Thanks for the help, again.

EDIT: When I attempted this, anything in between the label will still run. Pressing the key will cause whatever in between to run twice (if the OnEvent is before the function).
PPQ

User avatar
Rain
Automation Wizard
Posts: 550
Joined: Tue Aug 09, 2005 5:02 pm
Contact:

Post by Rain » Tue Nov 27, 2012 2:13 pm

Try...

Code: Select all

OnEvent>KEY_DOWN,VK115,0,Shutdown

SRT>Shutdown
  Exit>1
END>Shutdown


winstein
Pro Scripter
Posts: 84
Joined: Mon Nov 26, 2012 3:44 pm

Post by winstein » Wed Nov 28, 2012 3:22 am

Rain wrote:Try...

Code: Select all

OnEvent>KEY_DOWN,VK115,0,Shutdown

SRT>Shutdown
  Exit>1
END>Shutdown

This works! Thank you!
PPQ

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts