When a certain hotkey is pressed, ReRun asks you for a program and runs it. From then on, everytime this hotkey is pressed, the program is run again.
This is useful if you working to improve a script/ ahk file / batch file and need to test it repeatedly, or are needing to manually compile/deploy/run commands repeatedly. Using rerun is faster than finding the active window and clicking on a program to launch it.
; Change line 6 to a new hotkey: see http://www.autohotkey.com/docs/Hotkeys.htm#symbols
#NoEnv
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
§::
if program =
FileSelectFile, program, 3, , Open a file, Programs (*.bat; *.com; *.exe)
if program <>
{
SplitPath, program ,, OutDir
SetWorkingDir %OutDir%
RunWait, %program%
}
return
Note: the default hotkey is §, which is handy if you have a mac uk keyboard, but annoying if you don't. So change the start of line 5.
Mod Note: though the poster turned out to be a spammer, the script might be of use to someone.