Tricks Autoit Configuration

From AutoItScript Wiki

Jump to: navigation, search

[edit] Tricks and tips regarding AutoIt configuration

[edit] Add your own include path

When you have used AutoIt for a while you probably will have several UDF's in one or more files that you would like to keep track of. You can add the path to those files in the registry. If you do AutoIt will pick them up as any other include files.

SetIncludePaths(@ScriptDir & "\Include")
Exit
Func SetIncludePaths($myincludes)
	Local $sep = ""
	Local $val = RegRead("HKEY_CURRENT_USER\Software\AutoIt v3\AutoIt", "Include")
	Local $org = RegRead("HKEY_CURRENT_USER\Software\AutoIt v3\AutoIt", "OrgInclude")
	If @error <> 0 Then
		RegWrite("HKEY_CURRENT_USER\Software\AutoIt v3\AutoIt", "OrgInclude", "REG_SZ", $val)
		$org = $val
	EndIf
	If $org <> "" Then $sep = ";"
	If $val <> $org & $sep & $myincludes Then
		RegWrite("HKEY_CURRENT_USER\Software\AutoIt v3\AutoIt", "Include", "REG_SZ", $org & $sep & $myincludes)
	EndIf
EndFunc

This trick is shortly described in the helpfile in the #include page.

Personal tools