Open New Tab Adjacent to the Current Tab in Safari on macOS Ventura
Here is the behavior of Safari tabs work on macOS:
- If you ⌘-click a link or use the contextual menu to open a link in a new tab, that new tab will be created next to your current tab.
- If you make a new tab with File → New Tab (⌘T), the new tab will be created at the rightmost end of the tabs in the current window.
The behavioral mismatch is annoying. If I am working on a window with three tabs and I want to research something about the tab I am currently reading I want the new tab to open directly next to the current tab, generally.
To fix this you can use Automator, Apple Script, and Settings keyboard shortcuts.
Automator
- Launch Automator and create a New “Quick Action”
- Set the Workflow to receive no input in Safari
- Drag in a “Run AppleScript” item
- Paste in the following code
- Save the Workflow as “Safari New Tab Adjacent”
tell application "Safari"
tell front window
set _old_tab to current tab
set _new_tab to make new tab at after _old_tab
set current tab to _new_tab
end tell
end tell
System Settings
- Open System Settings
- Click Keyboard in the sidebar
- Click Keyboard Shortcuts button
- Click Services in the sidebar
- Drop down General
- Enable “Safari New Tab Adjacent” and give it a shortcut like ^⌘T
This is an update to a post on Daring Fireball using no additional software.