Forgive me if this has been covered, but I tried searching and could not find an answer.
Once a script has been started, is there a way to stop it?
I have very lengthy mouse clicking scripts. Occasionally something I did not anticipate ruins my scripts intended purpose. Since the mouse is going through the click actions with little to no hesitation (sleep), there is no way for me to pause or stop the script fast enough (via the task manager or task bar) since the mouse is unusable while the script is running.
Once a script has been started, is there a way to stop it?
Started by
Elias
, Sep 29 2009 01:51 PM
22 replies to this topic
#1
-
Posted 29 September 2009 - 01:51 PM
Put this hot-key in your script.
Press escape to stop it.
Press escape to stop it.
Escape:: ExitApp Return
#2
-
Posted 29 September 2009 - 01:56 PM
I typically use
This will kill the script ASAP.
There are variations, but ExitApp is probably what you were looking for.
Esc::ExitApp
This will kill the script ASAP.
There are variations, but ExitApp is probably what you were looking for.
#3
-
Posted 29 September 2009 - 01:56 PM
Esc::ExitApp ;Escape key will exit... place this at the bottom of the script
Also, you can use ANY key in place of the Esc key. See "key list" for usage.
#4
-
Posted 29 September 2009 - 01:57 PM
Also, look into ControlClick, and PostMessage for potential ways on which your script could function without the mouse.
I used to have lots of "MouseClick" scripts, but now I try and avoid them where possible.
MouseClick's generally are unreliable when thinking about future developments, portability, and user preferences.
Basically, things arent always where you expect them to be.
If you can refer to them in a way which doesnt change, your scripts will be far more reliable.
Also, it looks a hell of a lot better. I find that scripts that make the mouse move a lot generally dont look great.
I used to have lots of "MouseClick" scripts, but now I try and avoid them where possible.
MouseClick's generally are unreliable when thinking about future developments, portability, and user preferences.
Basically, things arent always where you expect them to be.
If you can refer to them in a way which doesnt change, your scripts will be far more reliable.
Also, it looks a hell of a lot better. I find that scripts that make the mouse move a lot generally dont look great.
#6
-
Posted 29 September 2009 - 02:04 PM
Thanks for the tip! I will definitely be looking into that.
It seems like every time I go to write a new script I discover a new capability of AutoHotKey that amazes me, and I'm sure I haven't even cracked the surface of it's capabilities.
It seems like every time I go to write a new script I discover a new capability of AutoHotKey that amazes me, and I'm sure I haven't even cracked the surface of it's capabilities.
#7
-
Posted 29 September 2009 - 02:11 PM
I have tha same problem, but when I insert
or
then WinActivate doesn't work.
Without Escape shortcut the script works.
Help!
Esc::ExitApp
or
Escape:: ExitApp Return
then WinActivate doesn't work.
Without Escape shortcut the script works.
Help!
#8
-
Posted 24 September 2010 - 10:44 PM
show us the full code that u are using that does not work
#9
-
Posted 24 September 2010 - 11:01 PM
Thank you
Pause::Pause
WinWait, Nuova scheda - Google Chrome,
IfWinNotActive, Nuova scheda - Google Chrome, , WinActivate, Nuova scheda - Google Chrome,
WinWaitActive, Nuova scheda - Google Chrome,
;clicco sulla tab
MouseClick, left, 114, 20
Sleep, 1000
msToWait=400
msLongWait=6000
x = -166
y = 0
Sleep msToWait
MouseClick, left, 75, 464
MouseClick, left, 377, 337
Sleep msToWait
MouseClick, left, 465, 310
Sleep msToWait
MouseClick, left, 411, 342
.
.
.
#10
-
Posted 24 September 2010 - 11:05 PM
If I delete the first line everything works properly...
#11
-
Posted 24 September 2010 - 11:06 PM
Put it at the end of the script it's messing with the Auto-execute Section.
#12
-
Posted 24 September 2010 - 11:22 PM
Is there a way how to terminate ANY script during its run without copying the Esc:ExitApp code into all of your scripts? Something that could probably go into the auto-execute section?
#13
-
Posted 24 September 2010 - 11:32 PM
Thank you a lot
I owe a beer to you...
Thank you again
I owe a beer to you...
Thank you again
#14
-
Posted 24 September 2010 - 11:34 PM
@ Machalik do you mean other than right clicking on it's tray icon
AHKPanic() a function for Pausing, Suspending, or Closing all running scripts
AHKPanic() a function for Pausing, Suspending, or Closing all running scripts
#15
-
Posted 24 September 2010 - 11:45 PM