Question

Open URL in new Safari tab with AppleScript

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

 45  109580  45
1 Jan 1970

Solution

 48

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
2010-05-25

Solution

 28

I think this also does what you asked for, but it is much shorter and is less browser-specific:

do shell script "open http://www.webpagehere.com"

This will open the specified URL in your default browser. And if you explicitly want to open it in Safari, use this:

do shell script "open -a Safari 'http://www.webpagehere.com'"
2012-10-05