【发布时间】:2016-12-20 19:14:49
【问题描述】:
我正在尝试创建一个苹果脚本,该脚本将数据从名为 Panorama 的应用程序复制并粘贴到 Excel 2011 for Mac。我的一切工作几乎都按照我想要的方式工作,除了让 excel 移动到相邻列并移动到第一个记录位置(键盘快捷键是“结束”键和向上箭头。我不知道如何让 applescript 识别与向上箭头组合的结束键。如果有人能告诉我如何做到这一点或其他方式,将不胜感激。
到目前为止,这是我的代码:
重复2次
repeat 2 times
tell application "Panorama" to activate
tell application "System Events"
tell process "Panorama"
keystroke "c" using command down
tell application "System Events" to keystroke (ASCII character 31)
end tell
end tell
delay 0.8
tell application "Microsoft Excel" to activate
tell application "System Events"
tell process "Microsoft Excel"
keystroke "v" using command down
tell application "System Events" to keystroke (ASCII character 31)
end tell
end tell
delay 0.8
end repeat
tell application "Panorama" to activate
tell application "System Events"
tell process "Panorama"
tell application "System Events" to keystroke (ASCII character 29)
tell application "System Events" to key code 115
end tell
end tell
delay 0.8
tell application "Microsoft Excel" to activate
tell application "System Events"
tell process "Microsoft Excel"
tell application "System Events" to keystroke (ASCII character 29)
tell application "System Events" to keystroke End using up arrow <----(This is the part not working.)
end tell
end tell
delay 0.8
结束重复
【问题讨论】:
标签: applescript osx-snow-leopard