我正在尝试为 Apptivate 编写一个 AppleScript,以在 Google Chrome 中打开当前的 Firefox 4 或 Safari 选项卡。Safari 部分有效,if 语句进入 Firefox,但它不复制 URL。
这是我的applescript,它不起作用:
tell application "System Events"
set myApp to name of first application process whose frontmost is true
if myApp is "firefox-bin" then
tell application "Firefox" to set theURL to the «class curl» of frontmost of window 1
tell application "Google Chrome"
activate
tell application "System Events" to keystroke "t" using {command down}
set URL of last tab of window 1 to theURL
end tell
else if myApp is "Safari" then
tell application "Safari" to set theURL to the URL in document 1
tell application "Google Chrome"
activate
tell application "System Events" to keystroke "t" using {command down}
set URL of last tab of window 1 to theURL
end tell
end if
end tell
我错过了什么?