Trying to check #nomatchfound

I have a sourceExtract line that works, but I want to check the value it gets. I’m using:
{
“Command”: “if”,
“Target”: “\”${answer}\" == \"#nomatchfound\"",
“Value”: “”
},
but in the log I get
[error] Error in runEval condition of if: unexpected token: identifier

I tried other syntax such as not quoting ${answer}, putting everything in parens, backslash before the # symbol, but I get various other errors. I’m assuming my syntax in Target is wrong, but in case it matters, there’s json in ${answer}.

Please help!

but in case it matters, there’s json in ${answer}.

This is the issue. So it is a bug, and I created a ticket for it.

test macro - it shows the same error as you get:

{
  "Name": "1",
  "CreationDate": "2019-1-17",
  "Commands": [
    {
      "Command": "open",
      "Target": "https://a9t9.com/kantu",
      "Value": ""
    },
    {
      "Command": "store",
      "Target": "{   \"Name\": \"Untitled\",   \"CreationDate\": \"2019-1-17\",   \"Commands\": [     {       \"Command\": \"open\",       \"Target\": \"https://a9t9.com/kantu\",       \"Value\": \"\"     },     {       \"Command\": \"store\",       \"Target\": \"123\",       \"Value\": \"a\"     },",
      "Value": "a"
    },
    {
      "Command": "if",
      "Target": "\"${a}\" == \"test\"",
      "Value": ""
    },
    {
      "Command": "echo",
      "Target": "yes",
      "Value": ""
    },
    {
      "Command": "endif",
      "Target": "",
      "Value": ""
    }
  ]
}

Thanks!

For now I’m working around it using sourceSearch to see if the thing I want is there first, then doing the extract. I’d rather verify the extracted data, but this works “well enough” :relieved:

Today is Oct 15, 2022 and this is still not working

{
  "Command": "gotoIf_v2",
  "Target": "${html_id} == \"#nomatchfound\"",
  "Value": "END_OF_UTIL",
  "Description": "Exit if the Action Item is not present"
},

Hello @Eltal what exactly does not work? Do you have a test macro? If I run the original macro, all works fine once I use === instead of ==, as recommended for Javascript string comparisons:

{
  "Name": "testhtml",
  "CreationDate": "2022-10-17",
  "Commands": [
    {
      "Command": "open",
      "Target": "https://ui.vision",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "store",
      "Target": "{   \"Name\": \"Untitled\",   \"CreationDate\": \"2019-1-17\",   \"Commands\": [     {       \"Command\": \"open\",       \"Target\": \"https://a9t9.com/kantu\",       \"Value\": \"\"     },     {       \"Command\": \"store\",       \"Target\": \"123\",       \"Value\": \"a\"     },",
      "Value": "a",
      "Description": ""
    },
    {
      "Command": "if_v2",
      "Target": "${a} === \"test\"",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "echo",
      "Target": "yes",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "end",
      "Target": "",
      "Value": "",
      "Description": ""
    }
  ]
}

I have learned something today,
${html_id} === "#nomatchfound" worked like a charm
Thanks