Let's start by getting some terminology straight. A script
is a single AutoHotkey file, e.g., MyHotkeysHotstrings.ahk
. It may contain any number of hotkeys and/or hotstrings — or it may contain none. A subroutine
is a set of AHK statements (identified by a label) that get called/executed via the Gosub
command. When the subroutine is done, it goes back to the caller via the Return
command, with the line after the Gosub
command being the next one executed.
When you run a script that has hotkeys and/or hotstrings in it, it stays running, known as Persistent
. So, "return to the beginning of your script" is not an issue, i.e., your script will stay running with all 30 hotkeys that you've defined remaining in effect, waiting to be fired when you hit the keyboard with them. The only way they'll stop running is via the Exit
context menu pick or executing the ExitApp
command in the script.
There are no subroutines in the code you posted. I don't know what you mean with the "inside of a subroutine" comment, unless you are confusing "hotkey" and "subroutine". Regards, Joe