Why OCRSearch is returning 2 when there is only one instance

Hi,
I am facing issue with OCRSearch it is returning 2 when only one instance is available. Seebelow my json snippet -

{
      "Command": "OCRSearch",
      "Target": "out",
      "Value": "matches"
    },
    {
      "Command": "if_v2",
      "Target": "${matches} == \"1\"",  --- Here $matches is having value 2 instead of 1
      "Value": ""
    },
    {
      "Command": "XClick",
      "Target": "SignOut_dpi_96.png",
      "Value": ""
    },
    {
      "Command": "else",
      "Target": "",
      "Value": ""
    },
    {
      "Command": "echo",
      "Target": "\"Already Signed Out\"",
      "Value": ""
    },
    {
      "Command": "end",
      "Target": "",
      "Value": ""
    }

Can you please help me here and point out what is going wrong?

Thanks,
Ashiskh

This could be an OCR recognition issue. Can you post the screenshot that you are OCR’ing? Then I can test it here.

Tips:

image

No,I need to do as following as suggested in the documentation

{
      "Command": "OCRSearch",
      "Target": "out@pos=1",
      "Value": "matches"
    }

This is @pos=1 is reliably working :slight_smile:

Thanks,
Ashiskh

Great idea!

For others: If you want to check if the x-th match of a text exists, you can use the @pos parameter: OCRSearch | text to search@pos=x | variable .