Open URL in new Safari tab with AppleScript

Mark Szymanski picture Mark Szymanski · May 23, 2010 · Viewed 88.3k times · Source

Is it possible to use AppleScript to open a link in a new tab in Safari?

Answer

Tim Lewis picture Tim Lewis · May 25, 2010

This will work:

tell application "Safari"
    tell window 1
        set current tab to (make new tab with properties {URL:"http://www.stackoverflow.com"})
    end tell
end tell