Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Checking text: x identical following lines (text + color) since x minutes
#1
Hello All,

I have two requests:

1. I would like to check if there is x RED identical following lines (4 lines for example) on a window since a specific period of time (since 2 minutes for example).
If there are 4 red identical following lines since 2 minutes then we need a click mouse on a specific button.
How can I proceed ?
What should be the command lines examples ?

2. I would like to check if there is x YELLOW identical following lines (4 lines for example) on a window with text of each line is different from "XXXX xxxx" since a specific period of time (since 2 minutes for example).
If there are 4 yellow identical following lines with text of each line is different from "XXXX xxxx" since 2 minutes then we need a click mouse on a specific button.
How can I proceed ?
What should be the command lines examples ?
Thanks in advance for your help
#2
Try dialog "Window text". To find it: floating toolbar -> 5-th button -> Window text. It creates code that can get window text and text color. Works not with all windows. In the dialog select "Get array". Click Select; move the mouse to the window/control; press Shift; click Test. If works with that window, must show red rectangles around all text items. Click OK. It inserts several lines of code in the macro, and also prints some sample code; select the sample code and drag-drop to the macro. Example:

Macro Macro109
Code:
Copy      Help
int wMain=win("Test" "CabinetWClass")
int w=child("" "DirectUIHWND" wMain 0x0 "accName=Items View") ;;list 'Items View'
WindowText wt.Init(w)
wt.Capture
for _i 0 wt.n
,WTI& t=wt.a[_i]
,out F"0x{t.color} {t.txt}" ;;pure red color is 0x0000FF; black is 0x000000.
#3
<< Works not with all windows >>
It doesn't work with the sepcific windows I need.
The others are OK but not this one...
Any other solution ?
#4
If some part of text is always the same, try dialog "Find image, wait". It is in the same toolbar/menu as dialog "Window text".

Else try dialog "Find accessible object". It is in the same toolbar/menu. Capture the text line. Click Test. Edit parameters so that would find the object with different text too. For example, use regular expression.
But it does not get text color. Will need to somehow combine the code with function pixel. Or with code created with dialog"Find image, wait". Quite difficult. At first try just to capture and find the object, because it works not with all objects.


Forum Jump:


Users browsing this thread: 1 Guest(s)