Auto check of OCR result - How to?

Hello, I have set up my first macro to open a desktop application, navigate through it to a destination, use OCR extract to scrape a section then use the echo command to display the result (a text string) in the logs.

What I am wondering, is it possible after the echo command to add another command that takes a piece of text I write and compare it to the result from the OCR extract?

Thanks for any help/advice

That sounds doable, but can you add a screenshot to clarify what you want to compare with what?

1 Like

Hey, thanks for offering to have a look. The actual macro is on my work computer so on my own computer I just setup a basic one using the calculator app to show you what I have done already and explain what I am trying to do next. This macro makes the calculator add 8+2, then click = , then OCRExtract to scrape the result of 10. The echo command then puts the result of 10 in the logs for me to see what was extracted (as shown in the screenshot below)

What I am thinking is this: I know the answer should be 10 so I would like have a command that takes the echo result of 10 and compares it to the known result I have somehow entered. I think that this comparison can then be entered into the log file as a pass (in green) or a fail (in red).

I hope that makes sense!

Also just to add I have tried the Assert command but I get a negative result even though the Logs show * [error][Line 8]Expected variable result to be 10, but it is 10