U sing #Include to Share Functions Among Multiple Scripts ¶
The #Include directive may be used (even at the top of a script) to load functions from an external file.
Explanation: When the script's flow of execution encounters a function definition, it jumps over it (using an instantaneous method) and resumes execution at the line after its closing brace. Consequently, execution can never fall into a function from above, nor does the presence of one or more functions at the very top of a script affect the auto-execute section .
L ibraries of Functions: Standard Library and User Library [v1.0.47+]
A script may call a function in an external file without having to use #Include . For this to work, a file of the same name as the function must exist in one of the following library directories:
%A_ScriptDir% \Lib\ ; Local library - requires v1.0.90+ .
%A_MyDocuments% \AutoHotkey\Lib\ ; User library.
path-to-the-currently-running-AutoHotkey.exe\Lib\ ; Standard library.