我正在尝试从 Safari 获取 URL,关闭选项卡并在 Chrome 中打开它()但我不断收到错误:
error "Safari got an error: Can’t get current tab." number -1728 from current tab
从代码行:
set theURL to URL of current tab of window 1
有什么建议么?
全部代码:
property theURL : ""
tell application "Safari"
set t set theURL to URL of current tab of window 1
close current tab
end tell
tell application "Google Chrome"
set URL of active tab of window 1 to theURL
activate
end tell
这个对我有用...
tell application "Safari"
set theURL to URL of current tab of window 1
end tell
您必须显示更多代码,因为错误是由其他原因引起的。让我问你,你是否在另一个tell 块内有tell application Safari 语句?也许它在告诉谷歌浏览器代码块内?如果是这样,请将其删除。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)