AutoHotKey Scripting Basics – The RunWait Command

The RunWait command is an extension of the Run command. However, as the name suggest, the RunWait command waits for the specified program to finish executing before continuing.

To simplify further, let’s consider once again the multi-line script example from the previous post:

Run Notepad.exe
Run Calc.exe

As I explained before, when you press the Win+m keys on your keyboard, the Run command will open these programs in a top-down sequential manner. But with the Run Command you can specify that the program on the next line opens only once the previous one has finished executing. As an example:

RunWait Notepad.exe

When you press Ctrl+N on your keyboard, the Notepad will open on your screen, and only after you close it will the Web site open up in your browser.

If you have to work repeatedly on certain applications in a specific order, you will find the RunWait command really useful. With just one little script, you will never need to bother opening these programs manually. I should warn you though, this gets addictive.


Leave a Comment