How to read text of an image from the list of EveryImageLocation


I have two items in the results from EveryImageLocation(). Now I want tor read the text for second image location. Can someone tell me what parameter should go into ReadText syntax for second image location?


I’m a bit of a novice, but if you drop the relevant portion of your script in here I can take a crack at it. You should be able to define a readtext area based off of the location results…

put EveryImageLocation(text:“xxx”, SearcRectangle[“xxx”, “xxx”]) into foundImages
put item 2 of foundimages into thisImage

put ReadText() - what should go into this line for reading the text of ‘thisImage’

Wait…You would have to know the text of the second image in order to find it ie: “xxx” in your above example is the text you are looking for so you already know what it is.

Unless “xxx” is a list or something and you are trying to assign which item from your list was in location 2?

Anyway, I think what you want is:
put readText(item 2 of EveryImageRectangle(text:“xxx”)) into Item2TextVar
log Item2TextVar

but here is my full study of the question:
Set the searchRectangle to [[550,400],[800,800]]
log item 2 of EveryImageRectangle(text:“Time”)
put item 2 of EveryImageRectangle(text:“Time”) into Item2LocVar
log "This is my location variable assigned from location 2 of the text I looked for: "&Item2LocVar
log readText (item 2 of EveryImageRectangle(text:“Time”))
log "This is the text that was at item 2’s location: "&readText (item 2 of EveryImageRectangle(text:“Time”))
//if you really want the text in the variable and not its location you could do this…
put readText(item 2 of EveryImageRectangle(text:“Time”)) into Item2TextVar
log Item2TextVar
set the SearchRectangle to []

Let me know if that doesn’t answer your question. I might be misunderstanding.

I would only know part of the text in advance but not the whole of it. So I would like capture full text with the part text I already know and this text appears in multiple locations.

Your reply answered my question .


1 Like