【发布时间】:2014-03-12 22:55:39
【问题描述】:
我找遍了高低,找不到答案。
如何将 URL 从 Chrome 复制并粘贴到 Excel 中?
基本上,我有一个工作项目,我必须将值复制并粘贴到搜索引擎中。我必须保存该搜索结果的 URL。我不知道如何使用 Applescript 来做到这一点。这是我到目前为止的代码。我知道这并不优雅,但我将不胜感激!
告诉应用程序“Microsoft Excel”激活
告诉应用程序“系统事件”
tell process "Microsoft Excel"
keystroke "c" using command down
end tell
说完
延迟 0.4
告诉应用程序“Google Chrome”激活
告诉应用程序“系统事件”
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
说完
【问题讨论】:
标签: excel macos google-chrome applescript