我搜索了高和低,並找不到答案。如何使用Applescript從Chrome複製並粘貼網址?
如何將Chrome中的網址複製並粘貼到Excel中?
本質上,我有一個項目,我必須複製並粘貼到搜索引擎的值。我必須保存該搜索結果的網址。我不知道如何使用Applescript來做到這一點。這是迄今爲止的代碼。我知道這不是優雅,但我會很感激任何幫助!
告訴應用程序 「Microsoft Excel中」 激活
告訴應用程序 「系統事件」
tell process "Microsoft Excel"
keystroke "c" using command down
end tell
末告訴
延遲0.4
告訴應用程序 「谷歌瀏覽器」激活
告訴應用程序 「系統事件」
tell process "Google Chrome"
keystroke "a" using command down
keystroke "v" using command down
end tell
delay 0.5
tell application "System Events"
tell process "Google Chrome"
keystroke return
end tell
end tell
delay 5.0
tell application "Google Chrome"
get URL of active tab of first window as text
end tell
delay 5.0
tell application "System Events" to keystroke "w" using command down
末告訴
告訴應用程序 「Microsoft Excel中」 激活
告訴應用程序 「系統事件」
tell process "Microsoft Excel"
keystroke tab
keystroke "v" using command down
keystroke down
keystroke left
end tell
末告訴