Default for Safari is new tab always opens way out at the end, which to this user is an illogical default.
Anyway...
The KBM CEO says possibly an AppleScript to the rescue?
Anyone got a suggestion for that - or another approach?
Default for Safari is new tab always opens way out at the end, which to this user is an illogical default.
Anyway...
The KBM CEO says possibly an AppleScript to the rescue?
Anyone got a suggestion for that - or another approach?
Hey @bhelmick,
Welcome to the forum!Ā
This seems to work pretty reliably with Safari on macOS 10.14.6 Mojave.
I'm not sure if it has any relationship to the tab settings, but here are mine just in case.
Open a New Tab Next to the Current Tab v1.00.kmmacros (5.8 KB)
-Chris
OK Chris, thanks,
I tried giving it a go.
However, youāve got a very very barely capable programmer here, although I did drop in an AppleScript one time and got that to work.
Here is the script you supplied - believe Iāve got it correctly
(() => {
// Change to a URL if desired.
const newDocURL = āabout:blankā;
const openTab = window.open(āā,ā_blankā);
openTab.location = newDocURL;
})();
So a couple of questions:
So I donāt even know what kind of script that is - AppleScript?
Assuming it was, the image below shows how I tried to set it up. It didnāt work but then Iāve got Ventura here so maybe that is the issue? FYI when you do up to Ventura, there are other issues. I couldnāt even get plain old Ctrl T to execute a Cmd T. Then Peter Lewis guessed correctly it was because Apple moved the location of Safari in Ventura so I had to set up a new macro group and link it to the new Safari. The old Safari icon also shows up, so I just selected both to make sure I got the right one, and it worked. But getting the tab to open next to the current one may ba a leap too far.
I also tried Swift script, and a couple of the other JavaScripts. With Swift Script it said I had to first supply the Swift tools from the command line
So what says Chris the Wizard! And with a guy with your expertise, why arenāt you up on Ventura!!
Brooks
Which of those is the type of script you used here
Hey Brooks,
I gave you a downloadable macro. You didn't download and install it?
Download it and double-click to install ā then make sure both the macro and the group it's installed into are enabled. (You may need to move it into your own Safari Group.)
Make sure Safari's Develop Menu is enabled:
Turn ON āEnable JavaScript from Apple Eventsā.
I'm living with a 2012 MacBook Air at the moment, and it doesn't support Ventura.
I really need to upgrade my hardware, but unfortunately my wallet has been saying no for a while.
Near death experience and hospitalization in 2020 hasn't helped on that front.
-Chris
Hi Christopher
Ah! Very slick.
No I hadnāt downloaded and clicked, but now have done - and put into both my old and new Safari Group, but alas, pressing \F1 didnāt do it.
See image for how it looks on screen.
Brooks
New tab locations are a hidden preference that can apparently only be changed through a Debug menu that itself can only be enabled through a defaults
command in the shell. See this Six Colors post for details and instructions:
That's Option-F1. Is that what you tried?
Did you turn ON āEnable JavaScript from Apple Eventsā? JavaScript cannot be run from AppleScript in Safari without that being on.
Another way to customize the placement of new tabs is to
Christopher et al
I missed turning on Allow JavaScript for Apple Events
Now it works
Youāre the man
Thanks to all
Brooks