Read text on the screen into a variable
Select the Region and text will be read using OCR technology.
The result will be set to a variable.
What you do with the variable is up to you. You can use Conditional and check if that text contains some word or compare if it's a number.
Using the icon in Bottombar.
This is the area to read the text. Same as a detection
OCR is not perfect, some font might give it a hard time and produce incorrect text ("I" and "l" look quite the same). That's where you need to "correct" it.
You can add many corrections. There are 3 type of correction: Find&Replace, Whitelist and Blacklist:
This is where you select the variable to set.
The result of the Text Reader will be written as a string.
Select Convert to number will attempt to convert the string into a number.
If conversion fails (string is not a number or text cannot be read) then the default value is returned if set or null.
Note: If you use a Conditional to compare the text (greater, lesser, etc...) then it automatically converts your text into a number. You only need to explicitly convert to number when you want to do arithmetic on it (plus, minus, etc...).
//Create a Region
var region = Region(x, y, w, h)
//Read from the region
var text = region.readAsString()
if (text) {
//Do something with the text
}
© 2024 - Macrorify by KoK-CODE