脚本的Safari 5.1中打开一个标签 [英] Script Safari 5.1 to open a tab

查看:303
本文介绍了脚本的Safari 5.1中打开一个标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:结果
  与AppleScript的新的Safari标签打开URL

Possible Duplicate:
Open URL in new Safari tab with AppleScript

我如何告诉Safari浏览器在当前窗口的新标签中打开一个URL?

How do I tell Safari to open a URL in a new tab of the current window?

这是打开网址的使用AppleScript的Safari浏览器的新选项卡中复制,但其答案不再与当前版本的Safari(5.1 10.6.8)的作品。该选项卡创建,但空的:

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

如果你犯了一个新的文件,而不是URL很荣幸,但是这将打开一个窗口。

If you make a new "document" instead the URL is honored, but this opens a window.

有关它的价值,我报这是苹果的bug。但是,一个解决办法将是巨大的。

For what it's worth, I reported this as a bug to Apple. But a workaround would be great.

推荐答案

我没有最新的Safari浏览器在这里,但是这可能工作

I don't have the latest Safari here, but this might work

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

这篇关于脚本的Safari 5.1中打开一个标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆