Home > Language Reference > System Variables > UseExact


The #UseExact system variable specifies if an exact match or a fuzzy match is used for windows recognition.


Used to force an exact recognition of windows.




A window name can change between the time 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 a UseWindow statement with the name as below is executed:
UseWindow("WORDPAD.EXE|RICHEDIT50W|Document - WordPad|1")
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 must be the same.
In this example, even if the underlined portion is different from the one specified in the script, the window will still be found:
UseWindow("WORDPAD.EXE|RICHEDIT50W|Document - WordPad|1")

If a matching window is still not found after the fuzzy match, Error Handling mechanism is then used.

See also