Applescript从Safari获取URL

Run*_*nar 2 safari applescript google-chrome

我正在尝试从Safari获取URL,关闭选项卡并在Chrome中打开它(TUAW Post)但我一直收到错误:

error "Safari got an error: Can’t get current tab." number -1728 from current tab
Run Code Online (Sandbox Code Playgroud)

从代码行:

set theURL to URL of current tab of window 1
Run Code Online (Sandbox Code Playgroud)

有什么建议?

所有代码:

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
Run Code Online (Sandbox Code Playgroud)

reg*_*633 7

这个对我有用...

tell application "Safari"
    set theURL to URL of current tab of window 1
end tell
Run Code Online (Sandbox Code Playgroud)

您必须显示更多代码,因为错误是由其他原因引起的.让我问你这个,你有另一个tell块中的应用程序Safari语句吗?也许它是在google Chrome代码块中?如果有,请将其删除.