#UseExact
System variable - Windows management
The #UseExact system variable controls how window names are handled when the script is running. The default value is 0, which means that the script finds a window even if it has a slightly different name than the one it had when the script was recorded (fuzzy matching).
Syntax
#UseExact = 0
or
#UseExact = 1Remarks
Some window names change between when the script was recorded and when the script is run; in that case, if #UseExact=1, the window is not found and an error message is displayed at execution.
If #UseExact=0 (default value), at execution WinTask looks for a window with nearly the same name before generating an error.
For instance, assume the window name as recorded in the script is:
"WORDPAD.EXE|RICHEDIT50W|Document - WordPad|1"
At execution, WinTask first looks for a window with exactly that name. If it cannot find one, it looks for a similar name, removing one character at a time from the end of the window title and window class. Only the first character of the class name is required.
In this example, even if the underlined portion is different from the one recorded in the script, the window will still be found:
""WORDPAD.EXE|RICHEDIT50W|Document - WordPad|1"
If a matching window is still not found after the fuzzy match, the UseWindow fails and the error message "Window not found" is displayed.