You can use AHK++ as a debugger for AHK scripts.
When an AHK file is open, press Ctrl+Alt+F9
to start debugging.
AHK++ adds run and debug buttons to the editor's title bar whenever an AHK file is opened.
- Open an AHK file
- Find the run button near the top right of the editor
- Click the dropdown alt of the run button
- Click "Debug AHK Script"
VS Code supports debug configurations definitions in .vscode/launch.json
. This can be a useful way to run your main.ahk
script from wherever you are in your workspace with a single keystroke.
-
Create
.vscode/launch.json
in your workspace -
Populate it with whatever launch config you prefer, for example:
-
Press
F5
to debug your project
AHK++ ignores the runtime
argument common in other debuggers. Instead, all debug sessions use either the V1: File > interpreterPath
or V2: File > interpreterPath
setting. See settings.md for details.
If debugging starts but suddenly stops silently, you may have a syntax error. Try just running your script, not debugging it, to see if it works. For advanced troubleshooting, see troubleshooting.md
Debuggers are hard to work with. Trying to start a debugger while in a debug session is difficult. Trying to debug a debugger at all is also difficult. Instead, we recommend adding log
calls, re-packaging the extension, re-installing it, and restarting extensions. Then you can work with the demos/manualTests/debugger.ahk*
files. Good luck, be patient, and be ready to read a lot of docs.