Clicking on relative text when there are several similar images

I am using uivision for desktop automation and i am stuck at this problem:
I have several places with same text (here: Pyschiatric Progress Note). I want to triple click on date that corresponds to the first in the list (list is sorted according to date). Using XClickRelative with image clicks on different date (here: 03/23/24 07:01 instead of 03/25/24 08:36). Same thing happens when i try using OCRExtractByRelative. I can’t say about OCRExtractByTextRelative as it doesn’t seem to work with texts having spaces in between.

Screenshot (295)

Correct. This is a known limitation that we will improve soon.

To do this, I would use “Clinical” as an anchor. You can either do this as image (XClickRelative) or as text (XClickTextRelative).

Good solution but it won’t work in my case as the list is dynamic i.e. the dates will not always be at exactly the same place all the time. the way i solved this is I used xclick with ocr to search for text (here: Pyschiatric Progress Note). this always selects the first occurence and not the nearest one. then i used !ocrx and !ocry to get the coordinates of the clicked text. then i changed !ocrx to select the date corresponding to the text. It works fine this way.

Thanks for looking into it

1 Like