Hi,
So I have this type of data: “Fees : $10.1123”
This works:
{
“Command”: “executeScript_Sandbox”,
“Target”: "return ${var}.split("Fees : “)[1];”,
“Value”: “varnodollarsign”
},
But if I also want to get rid of the dollar sign, like this:
{
“Command”: “executeScript_Sandbox”,
“Target”: "return {var}.split(\"Fees : “)[1];”,
“Value”: “varnodollarsign”
},
It doesn’t work anymore. Tried all kinds of brackets and quotes but to no avail.
It’s probably supereasy. Could anyone lead me in the right direction?
Thanks!
Here macro code
{
"Name": "Split",
"CreationDate": "2020-12-14",
"Commands": [
{
"Command": "store",
"Target": "Fees : $10.1123",
"Value": "MyVar"
},
{
"Command": "executeScript_Sandbox",
"Target": "return ${MyVar}.split(\"Fees : $\")[1];",
"Value": "MyVar"
},
{
"Command": "echo",
"Target": "${MyVar}",
"Value": ""
}
]
}
Log
[status]
Playing macro Split
[info]
Executing: | store | Fees : $10.1123 | MyVar |
[info]
Executing: | executeScript_Sandbox | return ${MyVar}.split("Fees : $")[1]; | MyVar |
[info]
Executing: | echo | ${MyVar} | |
[echo]
10.1123
[info]
Macro completed (Runtime 1.01s)
Okay, so I finally found the solution. Probably the only way I didn’t try. There must be an \ before the dollar sign. So “Fees : $” did work. All the best
Working all like a charm read my post
Here macro code
{
"Name": "Split",
"CreationDate": "2020-12-14",
"Commands": [
{
"Command": "store",
"Target": "Fees : $10.1123",
"Value": "MyVar"
},
{
"Command": "executeScript_Sandbox",
"Target": "return ${MyVar}.split(\"Fees : $\")[1];",
"Value": "MyVar"
},
{
"Command": "echo",
"Target": "${MyVar}",
"Value": ""
}
]
}
Log
[status]
Playing macro Split
[info]
Executing: | store | Fees : $10.1123 | MyVar …
Oh lol, I somehow missed your reply. Would’ve saved me time. But thank you for your input, really. Appreciate.
Click solution button in my post with macro code please
Thanks