I have written an AHK script that sends a set of keyboard keys when the hotkey ^!e:: is pressed. This script needs a couple of seconds to complete, but sometimes I need to stop the execution before the script has finished doing its task. I know that this can be done by setting the ExitApp function to another hotkey, but this will close the script. So, if I need to trigger the script again, it will be necessary to open the .ahk file anew.
How could the script be stopped without closing it? I would also need that, when it is triggered again, it sends the keys from the beginning, and not from where it left off when I stopped it.
Edit: let's take as an example this code,
^!q::
SoundBeep, 208
SoundBeep, 155
SoundBeep, 208
SoundBeep, 196
SoundBeep, 208
return


