Page 1 of 1

Ahk2exe: Passing built-in variables to #include

Posted: 16 Sep 2018, 02:59
by 2_05
As of AutoHotKey 1.1.28, support was added for all built-in variables in the path passed to #Include.

The following example shows that the compiler does not support all built-in variables yet.
The example requires an include file msgbox.ahk is placed in the folders C:\, the My Documents folder and the scripts folder.

The example can be run directly with autohotkey and shows three message boxes and opens WindowSpy. But when trying to compile using ahk2exe from the included compiler, compilation fails.

The preprocessor from the compiler seems to only support A_LineFile, A_ScriptDir, A_AppsData and A_AppsDataCommon

Code: Select all

#include C:\
#Include %A_MyDocuments%\msgbox.ahk
#Include %A_ScriptFullPath%\..\msgbox.ahk
#Include %A_ScriptName%\..\msgbox.ahk
#Include %A_AhkPath%\..\WindowSpy.ahk
MsgBox.ahk

Code: Select all

MsgBox, File %A_LineFile% Included

Re: Ahk2exe: Passing built-in variables to #include  Topic is solved

Posted: 11 Nov 2018, 02:06
by lexikos
Ahk2Exe v1.1.30.01 adds support for most built-in variables. See #Include.