The "#include" Command

AutoIt

The "#include" Command

In an AutoIt script, other scripts can be included using the "#include" command:

#include <filename to include>

e.g.

include.aut
MsgBox, 0, Example, This is from the "include.aut" file
Exit

script.aut
#include include.aut
MsgBox, 0, Example, This is from the "script.aut" file
Exit

Running the script.aut script will output the message box "This is from the 'include.aut' file", followed by "This is from the 'script.aut' file".

#include can be used anywhere in the main body of the script (not the ADLIB section) and will include the specified file at that position.  (If the include file contains an ADLIB section, it will be added to the overall ADLIB section!).