Open URL in new Safari tab with AppleScript

前端 未结 12 1727
挽巷
挽巷 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:17

    I can't comment :-/ so I will answer to say that Tim's answer (above) works as of OS X 10.8.5. This one-line version of his script also works:

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

    Arrgh -- the one line is overflowing. Here it is without the code tags:

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

提交回复
热议问题