Open URL in new Safari tab with AppleScript

前端 未结 12 1669
挽巷
挽巷 2020-12-13 12:43

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

12条回答
  •  春和景丽
    2020-12-13 13:22

    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'"
    

提交回复
热议问题