INI file access for Autohotkey
Installation
In a terminal or command line, navigate to your project folder:
npm install rd-config-ahk
In your code include the following to access those classes:
#Include, %A_ScriptDir%\node_modules\rd-regexp-ahk\rd_RegExp.ahk
#Include, %A_ScriptDir%\node_modules\rd-config-ahk\rd_WinIniFile.ahk
; and additionally if needed
#Include, %A_ScriptDir%\node_modules\rd-config-ahk\rd_ConfigWithDefaults.ahk
Description
These are classes to manage Windows INI files in Autohotkey.
All methods have function comments and if you're looking for examples check out the tests.
If you use the VS Code AutoHotkey Plus Plus extension, you might also want to check out Peak Definition (Alt+F12
) or Go To Definition (F12
).
These classes will throw an exception in case of a serious error by default which works well in combination with a global error handler. This behavior can be changed by setting class.throwExceptions := false
.
Methods
rd_WinIniFile.ahk
A class to read/write Windows INI files
Method | Description |
---|---|
writeString | Writes string to INI file |
writeSection | Writes complete section to INI file, an existing section will be overwritten |
writeArray | Writes an array of values with identical keys to an INI file |
getString | Get value from ini-file |
getBoolean | Get boolean value from ini-file |
getSection | Retrieve complete section from ini-file |
getArray | Read all values of a section for identical keys into an array |
getSectionNames | Read all section names of ini-file into an array |
rd_ConfigWithDefaults.ahk
A class to manage app settings stored in default and user data sources, where the user data source can override the default data source.
Method | Description |
---|---|
getString | Get value from data source |
getBoolean | Get boolean value from data source |
getArray | Get all values of a section for identical keys from data source |