我正在嘗試編寫Apptivate的AppleScript以在Google Chrome中打開當前的Firefox 4或Safari選項卡。 Safari部分工作,if語句步入Firefox,但不復制URL。AppleScript在Google Chrome中打開當前的Firefox 4選項卡
這是我的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
我缺少什麼?