Evaluating (parsing) a string as a mathematical expression can be a bit tricky in general. But for A+B it is easy. You can first split the string in two parts at the +, convert each part to an integer with parseInt and then add it. The macro below does this:
{
"Name": "eval1",
"CreationDate": "2023-9-4",
"Commands": [
{
"Command": "store",
"Target": "123+123",
"Value": "ocrresult",
"Description": ""
},
{
"Command": "executeScript_Sandbox",
"Target": "return ${ocrresult}.split(\"+\")[0].trim();",
"Value": "First_Part",
"Description": ""
},
{
"Command": "echo",
"Target": "${First_Part}",
"Value": "",
"Description": ""
},
{
"Command": "executeScript_Sandbox",
"Target": "return ${ocrresult}.split(\"+\")[1].trim();",
"Value": "Second_Part",
"Description": ""
},
{
"Command": "echo",
"Target": "${Second_Part}",
"Value": "",
"Description": ""
},
{
"Command": "executeScript_Sandbox",
"Target": "return parseInt(${First_part})+parseInt(${Second_part})",
"Value": "a",
"Description": ""
},
{
"Command": "echo",
"Target": "${a}",
"Value": "",
"Description": ""
}
]
}