Hammerspoon is needed because App Store apps are sandboxed and can't focus specific windows, can't run arbitrary scripts and AppleScripts.
What that gives you is the ability to map Right Option+letter to specific windows or tabs of the currently focused app.
So in your case you could dorcmd-s for Safari then ralt-m for mail tab, ralt-h for HN tab and so on, and it can also open those tabs/windows if they aren't already open.
And you also get a visual switcher to see what your options are in case you tend to forget these shortcuts.
Here are some examples of how I tend to use that feature: https://files.lowtechguys.com/rcmd-window-actions-h264.mp4
I'll have to make it more discoverable and user friendly though.