macossafaritabsapplescript

Safari new tab next to current one + tab-home


I've used the applescript from these link:

https://daringfireball.net/2018/12/safari_new_tab_next_to_current_tab

These applescript was used to open new tab in safari next to current active one, the problem is that the new tab opened is just a blank one, not the usual one with tab-home with bookmarks.

Any way to modify this?

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

Solution

  • 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
            set URL of current tab to {"favorites://"}
        end tell
    end tell