首页 文章

脚本Safari 5.1打开选项卡[重复]

提问于
浏览
4

可能重复:使用AppleScript在新的Safari选项卡中打开URL

如何告诉Safari在当前窗口的新选项卡中打开URL?

这是Open URL in new Safari tab with AppleScript的副本,但其答案不再适用于当前版本的Safari(5.1.6.6.6) . 选项卡已创建但为空:

tell front window of application "Safari"
make new tab with properties {URL:"http://www.stackoverflow.com"}
end tell

如果您创建一个新的“文档”而不是URL,但这会打开一个窗口 .

对于它的 Value ,我将此报告为Apple的一个错误 . 但是解决方法会很棒 .

1 回答

  • 5

    我这里没有最新的Safari,但这可能有效

    tell front window of application "Safari"
        set newTab to make new tab
        set the URL of newTab to "http://www.stackoverflow.com"
        set the current tab to newTab
    end tell
    

相关问题