How do I stop an active AutoHotkey script?

前端 未结 4 1135
失恋的感觉
失恋的感觉 2021-02-01 16:43

Yesterday while debugging my AutoHotkey script, I accidentally triggered an endless loop of MouseMove and MouseClick events. Every 0.5 seconds my mouse

4条回答
  •  迷失自我
    2021-02-01 17:00

    You could also make your script #SingleInstance force and watch for a "-quit" argument or something.

    #SingleInstance force
    #Persistent
    
    If A_Args[1] == "--stop"
        ExitApp
    
    ; just some random stuff for the script to do
    count := 0
    Loop,
    {
        count++
        Tooltip, %count%
        Sleep, 200
    }
    

    So you run the same script again but with the argument. And BAM its gone.

    Just for completeness. @Stevoisiak's answer is already great for the purpose requested.

提交回复
热议问题