How to open a new tab in the background in Chrome using AppleScript

How to open a new tab in the background using AppleScript in chrome. Opening a tab is so simple, but I just can't find what I can call to open a tab in the background, which means that the active tab remains the same.

+3
source share
1 answer

You can save active tab indexin a variable and set it after creating your tab:

tell application "Google Chrome"
    set activeIndex to get active tab index of window 1
    tell window 1
        set newTab to make new tab with properties {URL:"http://www.google.com/"}
    end tell
    set active tab index of window 1 to activeIndex
end tell
+11
source

All Articles