Skip to content

(EN) Configuration and Administration

Thekael edited this page Apr 24, 2023 · 6 revisions

Configuration of the Ini-File

The Ini-file contains a series of settings that control the behavior of the script. These can be changed in a text editor.

Some of the settings that can be configured in the Ini-file include:

  • The maximum number of search results to be displayed in the results list
  • The path to the data sources (Excel, CSV, or SQLite)
  • The definition of hotkeys for various actions
  • The default display of the dropdown boxes
  • The default selection of the browser

It is important that the Ini-file is formatted correctly. Incorrect syntax can cause the script to stop functioning properly.

It is recommended to create a backup of the Ini-file before making changes and to perform changes step by step to avoid potential issues.

The Ini-File

The Ini-file is organized into sections, and variables must be defined in the corresponding section, as the script will not read them otherwise. If a variable is not read, the script assigns it a default value. If a variable is not to be used, the line can be deleted or assigned the value "X".

It is important to note that some settings in the Ini-file can and should be adjusted by "regular" users. However, damaged Ini-files can cause the script to not run properly. Therefore, it is recommended to implement changes gradually and to create backups of older versions.

Ini-File with line numbers

Section: GENERAL

The "GENERAL" section of the Ini-file contains configuration parameters that are relevant for developers and administrators.

One of these parameters is SQLITE_DLL_PATH=.\sqlite_dll\dll64\sqlite3.dll. Since the script uses SQLite databases, the DLL file "sqlite3.dll" is necessary. This can be downloaded from the official SQLite project homepage: SQLite.org. It is important to ensure that the correct version of the file is used. Depending on whether the script was compiled in AHK with 32- or 64-bit, the corresponding version of the DLL file must be chosen. The repository contains the 64-bit version by default, and AntAi.exe is also compiled for 64-bit.

SQLITE3TOOL_PATH=.\sqlitetools\sqlite3.exe

The "sqlite3.exe" tool is required to import CSV files. It can also be downloaded from the SQLite homepage and boasts excellent performance during import. The AntAi script has been aligned and tested with version 3.41.2 of sqlite3.exe and sqlite.dll.

KNOWLEDGE_PATH=.\KNOWLEDGE_DB\AntAiKNOWLEDGE.db3

The variable KNOWLEDGE_PATH defines the path to the central SQLite database of the AntAi script, in which all data sources are aggregated in a table. This database is the main source for the script and is referred to as (k) in the overview of the AntAi script.

Section: MANDATORY_HOTKEYS

The same abbreviations are used as in Autohotkey (AHK) v1. Detailed documentation can be found on the official AHK website www.autohotkey.com or specifically for the issue mentioned above at www.autohotkey.com/docs/v1/Hotkeys.htm.

We only remind here of the most important "Hotkey Modifier Symbols":

  • # Windows-Key
  • ^ Ctrl-Key
  • + Shift-Key

It should be noted that multiple hotkeys can be assigned to one action, which are then separated by ";". For example: HK_HELP=#F1;#F11.

It is advisable to define the hotkeys in such a way that they do not overlap with existing hotkeys on the operating system or other programs to avoid conflicts.

HK_RUN_DEFAULT=!y This hotkey triggers the default search, using the string that is either in the clipboard or the current selection.

HK_ADD_DEFAULT=!a This allows you to add another search condition after a search has already been performed. The string in the clipboard or the current selection is used as an additional search condition.

HK_CHANGE_DEFAULTMODE=!Tab This command allows switching the default search mode in AntAi. There are three options to choose from:

  • Header Search: Only searches in the headers of the data source.
  • Tag Search: Only searches in the "search_in" and "fit_to" columns.
  • Full Search: Searches in all columns of the data source, including "info_html", "output", and "output_2".

The chosen mode determines in which columns the search result can be found.

HK_RUN_ALLCOLS=F1 This command immediately starts a full-text search in all available columns of the knowledge database using the text in the clipboard or the current selection.

HK_RUN_ADD_ALLCOLS=!F1 Adds another search condition to the already found result using the string in the clipboard or the current selection. A full search is performed, meaning it searches in all columns.

HK_HELP=#F1;#F11 Opens a small, text-based help window.

Section: OPTIONAL_HOTKEYS

Indeed, it makes sense to use as few hotkeys as possible to avoid confusion and ensure intuitive operation. By switching the search mode (see HK_CHANGE_DEFAULTMODE), the number of required hotkeys can be reduced, which increases user-friendliness.

HK_RUN_HEADER=X Directly starts a search in all header columns (H1, H2, H3) using the text in the clipboard or the current selection.

HK_RUN_ADD_HEADER=X Directly adds a search condition (overview search, i.e., in all header columns) to the current search result.

HK_RUN_TAG=X Directly starts a search in all tag columns ("search_in" and "fit_to") using the text in the clipboard or the current selection.

HK_RUN_ADD_TAG=X Directly adds a search condition (in the "search_in" and "fit_to" columns) to the current search result using the string in the clipboard or the current selection.

HK_REBUILD_DB=#F3 This hotkey rebuilds the Central AntAi Knowledge Database. The data from the files listed in the SQLITE_INPUTS, XLS_INPUTS, and CSV_INPUTS sections are collected and transferred to the central database.

HK_OPEN_DB=#F2 Opens the central (AntAi) database with the default program for db3 files on the computer.

HK_EXECUTE_CLIPBOARD=!x;^XButton1 Attempts to execute the text in the clipboard using the "Run" function. This feature can help quickly access entries found in the AntAi database after they have been copied to the clipboard. This functionality can, of course, be used elsewhere as well.

HK_TOY_TRANSPARENCY=^RButton This function allows you to change the transparency of a window and keep it always on top. Pressing it multiple times toggles between different modes. This is a small extra feature that gives the user a higher degree of control over the window.

Section: XLS_INPUTS

XLS_1=.\LOCAL_SOURCES\SRC_EX1.xlsx

XLS_2=.\LOCAL_SOURCES\SRC_EX2.xlsx

In this section, only valid Excel files can be specified. It is possible to use both relative and absolute path specifications for the data source.

The base for relative path specifications is the script's execution directory. The Excel files must follow a specific structure, which is explained in more detail in the "Import from Excel " section.

If you want to define multiple Excel files as input, you can do this by using a consecutive number in the parameter name: XLS_1, XLS_2, XLS_3, ...

If you want to define multiple Excel files as input, you can do this by using a consecutive number in the parameter name: XLS_1, XLS_2, XLS_3, ...

Section: CSV_INPUTS

In this section, only valid CSV files can be specified. It is possible to use both relative and absolute path specifications for the data source. The base for relative path specifications is the script's execution directory. Details on the import format can be found in the Import from CSV section.

CSV_1=.\LOCAL_SOURCES\SRC_OUTAGE_2021.csv

CSV_2=.\LOCAL_SOURCES\SRC_OUTAGE_2022.csv

CSV_3=.\LOCAL_SOURCES\TEST_STD1.csv

CSV_4=.\LOCAL_SOURCES\TEST_SHORT2.csv

If you want to define multiple CSV files as input, you need to distinguish them by a consecutive number in the parameter name, for example: CSV_1, CSV_2, CSV_3, ...

Section: SQLITE_INPUTS

In this section, only valid SQLite files can be specified as data sources. Both relative and absolute path specifications can be used, with the base for relative path specifications being the script's execution directory. Details on the import format can be found in the Import from SQLite section. If you want to define multiple SQLite files as input, they can be distinguished by a consecutive number in the parameter name: SQLITE_1, SQLITE_2, SQLITE_3, ...

SQLITE_1=.\LOCAL_SOURCES\DBSRC_PSP.db3

Section ETC

DISPLAY_ROW_LIMIT=500

After a search has been performed, the found results are displayed in rows. The variable "MAX_RESULTS_DISPLAYED" determines the maximum number of results to be displayed in the output table. It should be noted that the limit is only restricted to the displayed rows and does not affect incremental search.

QRY_ROW_LIMIT=1000

After a search, the results are displayed in rows. This setting defines the maximum result limit for queries, which provides better performance for large databases and limited computing power or storage capacity. It should be noted that this limit not only restricts the number of displayed rows but also affects incremental search.

SHOW_TAG_SELECTOR=1

The variable "SHOW_TAG_SELECTOR" is responsible for displaying dropdown lists in the headers of the result table. If its value is set to "1", these dropdown lists will be displayed to ensure better clarity. If the value is set to "0", no dropdown lists will be displayed, which can improve the runtime of search and display.

SHOW_ALLTAGS_SELECTOR=1 If the value of this variable is set to "1", all headers in the AntAi knowledge database will be displayed in dropdown lists. This gives the user an overview of the entire data inventory. If the value is set to "0", no dropdown lists will be displayed, leading to a faster startup time of the script.

HTML_BUFFER_FILE=.\TEMP_FILES\AntAi_out.html

In this section, you can specify the filename and path under which the script should store the HTML output. Both absolute and relative path specifications to the execution directory are possible.

POPUP_DELAY_MS=700

After the search mode has been changed via a hotkey, an info-popup is displayed to the user, which disappears automatically after a certain time. In this variable, you can define the time in milliseconds after which the info-popup will automatically disappear.

USE_INMEM_DB=1

If USE_INMEM_DB is set to "1", the AntAi knowledge database (defined in KNOWLEDGE_PATH) will be held in memory during the script's runtime. If the value is "0", the script reads the database from the file system. Using the in-memory functionality can speed up searches in large databases but requires more memory.

Section: RUN_CONFIG_STD

RUN_CONFIG_STDOUT_BROWSER = chrome.exe

This variable defines the default browser used for displaying the search results, i.e., displaying the HTML page. If no browser is specified, the script will use the system's default browser for HTML files.

Section: RUN_CONFIG

Using the hotkey defined in HK_EXECUTE_CLIPBOARD, commands stored in the clipboard can be executed. In the following, various command patterns can be associated with a program. Inside the double curly braces {{...}}, there is a regular expression that is compatible with Autohotkey (AHK). If the command in the clipboard matches the regular expression, the command string in the clipboard is inserted in place of the regular expression {{...}}. This means that {{...}} is replaced by the clipboard text and then executed.

An example of RUN_CONFIG_1=msedge.exe {{(html|htm|svg|pdf)$}}:

  • If the clipboard contains the string "C:\temp.pdf", it matches the regular expression (html|htm|svg|pdf)$.
  • Now it is replaced, and the result is msedge.exe C:\temp.pdf.
  • Finally, the script executes the command msedge.exe C:\temp.pdf.

Command patterns can be defined with any program. The patterns are processed in sequence, and execution occurs at the first match. Various programs like Excel, Notepad, or Chrome can be used. The corresponding configurations are defined by RUN_CONFIG_1, RUN_CONFIG_2, RUN_CONFIG_3, ... For example:

RUN_CONFIG_1=msedge.exe {{(html|htm|svg|pdf)$}}

RUN_CONFIG_2=chrome.exe {{(html#.*)$}} --new-window

Section: DEV

Everything in this section has not yet been fully implemented and is still in development, meaning it can be ignored.

HTML_TEMPLATE_FILE=X

HTML_BUFFER_ADD_TIME=0