Switch to left or right window in split view

Is it possible to create a shortcut to activate the left window in a split view? I.e. to switch to the left window if the right is currently active, or do nothing if the left window is already active. (And vice versa for the right window.)

I’d be happy to dig into AppleScript or even use a third party tool to achieve this if necessary.