#Include lib\*.ahk Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
Posts: 193
Joined: 24 Jun 2015, 23:38

#Include lib\*.ahk

26 Apr 2017, 17:54

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.

Re: #Include lib\*.ahk  Topic is solved

27 Apr 2017, 03:32

You could prepare a launch script, that prepares and include-file, which is #include-d in your main script.

Launch scripts loops *.ahk generating

Code: Select all

#include lib1.ahk
#include lib2.ahk
#include lib3.ahk
; etc
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)
Posts: 193
Joined: 24 Jun 2015, 23:38

Re: #Include lib\*.ahk

03 May 2017, 23:42

Already had a launcher running for the scripts that needed this, so this solution worked quite nicely without having to add very much... thanks.

Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot], Bodhi, boiler, bxgchoi, hasantr, mikeyww, Xsawers and 57 guests