What are directives?

Directives affect your script in a special way: usually, all your code is executed if and when the script “reaches” it. Directives are processed just before the script starts and allow you to customize AutoHotkey’s behaviour.

There are 2 basic types of directives:

All directives in AutoHotkey begin with an #.

non-positional directives

Non-positional directives are a kind of “setting” for your script. They affect how your script behaves during execution, control features or change the script’s syntax. It doesn’t count where in the script they are used, and using them multiple times is useless.

Important non-positional directives include:

positional directives

Positional directives of course also affect the script, but the place where they are used matters, and using them multiple times isn’t automatically nonsense. You can affect hotkeys and hotstrings, include code in your script and do a lot more things.

Important positional directives include: