Problem with if_v2

The same solution with ExecuteScript_Sandbox would be:

{
      "Command": "ExecuteScript_Sandbox ",
      "Target": "return Number (${variable})+20;",
      "Value": "Variable2"
    },
    {
      "Command": "echo",
      "Target": "${Variable2}",
      "Value": ""
    },

The key difference is the Number keyword to make sure we treat the var content as number, not as string!

See also: If_v2 command problem - #5 by ulrich

JavaScript Number() Function:

The Number() function converts the object argument to a number that represents the object’s value.

If the value cannot be converted to a legal number, NaN is returned.

Note: If the parameter is a Date object, the Number() function returns the number of milliseconds since midnight January 1, 1970 UTC.

2 Likes