编写 Safari 5.1 脚本来打开选项卡
我该如何判断Safari 在当前窗口的新选项卡中打开 URL?
这是使用 AppleScript 在新 Safari 选项卡中打开 URL,但是它的答案不再适用于当前版本的 Safari(10.6.8 上的 5.1)。该选项卡已创建但为空:
tell front window of application "Safari"
make new tab with properties {URL:"http://www.stackoverflow.com"}
end tell
如果您创建一个新的“文档”,则会采用 URL,但这会打开一个窗口。
不管怎样,我将此作为一个错误报告给了苹果。但解决方法会很棒。
Possible Duplicate:
Open URL in new Safari tab with AppleScript
How do I tell Safari to open a URL in a new tab of the current window?
This is a duplicate of Open URL in new Safari tab with AppleScript, however its answer no longer works with the current version of Safari (5.1 on 10.6.8). The tab is created but empty:
tell front window of application "Safari"
make new tab with properties {URL:"http://www.stackoverflow.com"}
end tell
If you make a new "document" instead the URL is honored, but this opens a window.
For what it's worth, I reported this as a bug to Apple. But a workaround would be great.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我这里没有最新的 Safari,但这可能有用
I don't have the latest Safari here, but this might work