Automatically switch Chrome Profiles?

Hi, I am currently writing a macro and would love your help with something. When they the Macro is done, I want it to switch Chrome Users by typing CTRL + SHIFT + M, and run the same macro on that profile. I know how to get this far, but in order to pick the next chrome user, the macro must:

1 - Press only the enter key the first time the macro is run.
2 - If !loop > 1, press TAB key x+1 times to cycle to next user from the Chrome profile dropdown, then press the enter key to select.

The macros must not press the TAB key on the first instance, as that profile will already be selected.

After a day and a half wrestling with the code, my question is how exactly would I achieve that? The macro must obviously perform this a set number of times (number of Chrome profiles) and I know I can probably do something with a CSV where I enter in the numer of active profiles, but not sure how to bring it all together.

Would you even recommend me doing it this way, or something else, like possibly creating a CSV with the filepaths of those chrome profiles and perform a run command to select it?

I would appreciate any help on this, as well as a look at what the code might actually look like, thanks!

You can check “If ${!loop} == “1”…”

Other possible solution for automatic profile switching:

You can use the Chrome or Firefox command line to start it with a certain profile:

and then start the macro via the UIvision command line API.