Is it possible to include all function libraries in the lib\ folder via a single include statement somehow?
For a few scripts I am calling functions via fn.call() where I want to automatically include libraries. Since the function isn't explicitly referenced, the include statements have to list the libraries individually.
For example, passing in a function
lib1_myFunc() requires #Include <lib1> at the end of the file
lib2_myFunc() requires #Include <lib2> at the end of the file
What I would like is #Include <*.ahk> or something similar.
Currently what's happening is that if I add a new library or call a function in a library that's not referenced, then it can't find it (as expected), but that means a lot of manually adding libraries to the include list every time I have a new or updated lib filename.
#Include lib\*.ahk Topic is solved
-
- Posts: 204
- Joined: 24 Jun 2015, 23:38
Re: #Include lib\*.ahk Topic is solved
You could prepare a launch script, that prepares and include-file, which is #include-d in your main script.
Launch scripts loops *.ahk generating
than you only include that file in your main script (so it only has one #include)
(also check out https://autohotkey.com/board/topic/2028 ... mework-10/ just in case)
Launch scripts loops *.ahk generating
Code: Select all
#include lib1.ahk
#include lib2.ahk
#include lib3.ahk
; etc
(also check out https://autohotkey.com/board/topic/2028 ... mework-10/ just in case)
-
- Posts: 204
- Joined: 24 Jun 2015, 23:38
Re: #Include lib\*.ahk
Already had a launcher running for the scripts that needed this, so this solution worked quite nicely without having to add very much... thanks.
Who is online
Users browsing this forum: No registered users and 184 guests