脚本Safari 5.1打开选项卡

Tob*_*ias 4 safari applescript

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

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

与使用AppleScript的新Safari选项卡中Open URL重复,但其答案不再适用于当前版本的Safari(5.1 on 10.6.8).选项卡已创建但为空:

tell front window of application "Safari"
make new tab with properties {URL:"http://www.stackoverflow.com"}
end tell
Run Code Online (Sandbox Code Playgroud)

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

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

Fla*_*ino 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
Run Code Online (Sandbox Code Playgroud)