Code: Select all
A_ScriptDir "\Lib\" ; Local library.
A_MyDocuments "\AutoHotkey\Lib\" ; User library.
"directory-of-the-currently-running-AutoHotkey.exe\Lib\" ; Standard library.
There is a disadvantage that file and directory structures are forced.
Scripts must exist in the path that has the "Lib" subfolder.
When using 'User library',
There is a disadvantage of being combined with the library of other projects.
I want to keep libraries that use only certain projects separately.
When using 'Standard library',
I have to do something cumbersome and unnecessary like having to copy the executable file separately to a specific project path and then run it.
Code: Select all
#Include A_LineFile\..\core\Lib\MyLib.ahk ; bad
#Include <MyLib> ; good
It is a cumbersome task that needs to be modified whenever the file structure in the project changes.
I wish I could add a libpath as an environmental variable AHKLIBPATH like LIBPATH in VC++.
Code: Select all
set AHKLIBPATH=X:\MyProject\core\Lib