How to get variable out of URL with executeScript_Sandbox

Dear community ,

I would like to get a variable from an URL.
As far as I know executeScript supports Java Sript.

As a beginner, I would like to know how to use it in combination with getQueryVariable().
My Url looks like this:

I need the number 12345.

Thank you in advance!

To slice of parts of a string, use the “substring” JS function. The internal var ${!URL} contains the current URL.

executeScript_Sandbox | var s = ${!URL}; s = s.substring(s.lastIndexOf("=") + 1, s.length); return s; | number

Test macro:

  "Name": "slice",
  "CreationDate": "2020-5-9",
  "Commands": [
      "Command": "store",
      "Target": "",
      "Value": "myurl"
      "Command": "executeScript_Sandbox",
      "Target": "var s = ${myurl};  s = s.substring(s.lastIndexOf(\"=\") + 1,      s.length); return s; ",
      "Value": "n"
      "Command": "echo",
      "Target": "${n}",
      "Value": "lime"