[Help needed] bot to focus on new window opened by bot actions

I am writing a process where the robot logs into a website with credentials stored in the secrets vault, proceeds to click on a link which would normally open in a new tab, however when doing this action with the robot, it opens in a new window, even if I use the mouse click action to right click the link, and open in new tab.
After this happens the robot is unable to interact properly with the new window, it can’t find images or links to click (trying with both XPath and Image Recognition).

Any suggestions on how to make it use the newly opened window?

I tried the Switch Browser action, however if I am not mistaken, this means it will re-focus on the old window that was opened with the ‘open website’ action.

Any help is appreciated

Linda

Try using this custom script to switch to a new window