ClickOnText
Windows management function.
The ClickOnText function simulates a click on the specified text or near the specified text.
Syntax
ClickOnText(<text>,<offset_x>,<offset_y>,<action>,<button>)
or
ret=ClickOnText(<text>,<offset_x>,<offset_y>,<action>,<button>)Parameters
<text>, string (variable or constant) : the mouse click is made on that <text>. During the time delay specified by #ActionTimeout, WinTask tries to find this <text> in the window specified by the last statement UseWindow and clicks. Such a function UseWindow must be just before the ClickOnText. If the text is not found, no error is generated and the script continues.
<offset_x>,<offset_y> : coordinates of the click offset from the middle of the specified text. If these values are 0, the click occurs in the middle of the text. These offsets allow you, for example, to click an icon just above the specified text.
<Action> : single or double click.
<Button>, mouse button used to click the text, the keywords are Left or Right.
Return value
Ret, numeric return code. When the text is found, the function returns 0, otherwise this return code has a value different from 0 (1 if the text is not found).
Remarks
This function can be used when standard functions (ChooseItem,&ldots;) cannot click the proper icon (non-standard Windows applications).
Use the Insert/Statement menu and select ClickOnText in order to automatically generate this statement.
Script execution does NOT stop in case of an error while executing ClickOnText
Examples
UseWindow(...)
ClickOnText("Demonstration",0,0,Single,Left)