小编Run*_*nar的帖子

Applescript从Safari获取URL

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

safari applescript google-chrome

2
推荐指数
1
解决办法
8856
查看次数

标签 统计

applescript ×1

google-chrome ×1

safari ×1