How to run macro in batch?

I’m new to using UI Vision. I want to know how do I run a macro one after another in specific firefox profiles and wait for it to finish playing macro then close browser and open the next macro?

windows bat

"C:\Program Files\Mozilla Firefox\firefox.exe" -P "hatch1" "file:///C:/Users/Administrator/Downloads/Script/ui.vision.html?storage=browser&macro=scroll-down-1&direct=1&closeRPA=0&closeBrowser=0"
"C:\Program Files\Mozilla Firefox\firefox.exe" -P "hatch2" "file:///C:/Users/Administrator/Downloads/Script/ui.vision.html?storage=browser&macro=scroll-down-2&direct=1&closeRPA=0&closeBrowser=0"
"C:\Program Files\Mozilla Firefox\firefox.exe" -P "hatch3" "file:///C:/Users/Administrator/Downloads/Script/ui.vision.html?storage=browser&macro=scroll-down-3&direct=1&closeRPA=0&closeBrowser=0"
{
  "Name": "scroll-down-1",
  "CreationDate": "2025-1-11",
  "Commands": [
    {
      "Command": "open",
      "Target": "https://www.reddit.com/",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "pause",
      "Target": "3",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "XMove",
      "Target": "xpath=/html/body/shreddit-app/div",
      "Value": "",
      "Targets": [
        "xpath=/html/body/shreddit-app/div",
        "xpath=//shreddit-app/div",
        "css=body > shreddit-app > div.grid-container.theme-rpl.grid"
      ],
      "Description": ""
    },
    {
      "Command": "pause",
      "Target": "3",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "XMouseWheel",
      "Target": "10000",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "XMouseWheel",
      "Target": "10000",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "XMouseWheel",
      "Target": "10000",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "XMouseWheel",
      "Target": "10000",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "pause",
      "Target": "3",
      "Value": "",
      "Description": ""
    }
  ]
}

It doesn’t seem to working as it’s launching multiple firefox instances instead of waiting for the last macro to finish. I want it to wait finish playing the macro, close then open the next profile browser. I don’t want it to run simultaneously

I think with powershell you have more control. But for Windows batch, does this work?

start /wait "" "C:\Program Files\Mozilla Firefox\firefox.exe" -P "hatch1" "file:///C:/Users/Administrator/Downloads/Script/ui.vision.html?storage=browser&macro=scroll-down-1&direct=1&closeRPA=1&closeBrowser=1"

  • I added /wait
  • and I changed the command line to closeRPA=1&closeBrowser=1 so that Firefox is closed when the macro is done.

Nope it still launches multiple instances. How do you do it with power shell? I’m not a programmer so can you provide a simple copy & paste code with minor edits