我正在尝试从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)