It would be very handy to activate/focus an existing browser tab instead of just letting Safari handle opening the linked URL. Safari (at least in 12.1.2), switches to the existing tab as desired, but reloads it. Ideally it would just switch to the existing tab without the reload. An example use case for this would be long web-based documents (Google docs, Dropbox Paper, etc.). When Safari reloads these, the scroll position is lost (in addition to the time wasted finding your previous position in the document, time is also lost waiting for the reload itself to occur). So, yes, this is using Hook beyond just a “linker” and also using it as an app switcher.
The desired Safari behavior is achievable through Apple Script but I’m running into trouble getting it to work as a Custom Open Item script.
Is a custom Open Item script possible with browsers? I notice Chrome, Firefox and Safari don’t have this script out-of-the-box, indicating that macOS is handling the call.
If it is possible, what should be used as the Scheme? I’ve tried
url with no success. (I notice that Apple Mail, Airmail and MailMate all used the
For testing purposes, I entered a simple Open Item script that just opens an alert dialog box with a “testing” string. However I don’t get an alert when opening a linked Safari URL via Hook. Safari just goes ahead and reloads the page in the existing tab (or opens a new tab if it doesn’t exist). It seems like my Open Item script is being bypassed. Any pointers? Thanks in advance!