我需要帮助纠正下面的脚本,以便自动执行一项非常平凡的复制/粘贴任务,我必须在接下来的几周内完成这些任务,列表会有所不同。
我通过公司网站报告了WIKI,我们可以在客户ID
中加载以运行该客户ID
的报告。我有一个1,300个客户的列表,我需要在不同的几周内运行此报告,并将这些客户端ID
(目前在Excel工作表中)复制/粘贴到WIKI中以运行这些报告。
当前工作流程: 从Excel复制客户端ID,选择Chrome窗口并单击文本框,粘贴,单击选项卡,以便WIKI显示下一个文本框,以便我添加客户端ID,返回Excel副本并重复... 1300次。 ..
我找到following site并尝试修改他们必须工作的代码,但我认为字典从那时起已经改变了。我试着看,但一直无法理解。
repeat 2 times
tell application "/applications/Microsoft Excel.app" to activate
tell application "System Events"
tell process "Microsoft Excel"
keystroke "c" using command down
end tell
end tell
delay 0.3
tell application "/Applications/Google Chrome.app" to activate
tell application "System Events"
tell process "Google Chrome"
keystroke "v" using command down
keystroke tab
end tell
end tell
delay 0.3
tell application "/applications/Microsoft Excel.app" to activate
tell application "System Events"
tell process "Microsoft Excel"
keystroke return
delay 0.4
keystroke "c" using command down
delay 0.3
end tell
end tell
delay 0.3
tell application "/applications/Google Chrome.app" to activate
tell application "System Events"
tell process "Google Chrome"
keystroke "v" using command down
keystroke tab
end tell
end tell
delay 0.3
end repeat
我必须每月运行这些报告并完成所有工作以正确配置这些客户端,以便他们在WIKI中拥有数据。
答案 0 :(得分:0)
问题是,当AppleScript只需要名称时,您将目录用于App:此处:
repeat 2 times
tell application "Microsoft Excel" to activate
tell application "System Events"
tell process "Microsoft Excel"
keystroke "c" using command down
end tell
end tell
delay 0.3
tell application "Google Chrome" to activate
tell application "System Events"
tell process "Google Chrome"
keystroke "v" using command down
keystroke tab
end tell
end tell
delay 0.3
tell application "Microsoft Excel" to activate
tell application "System Events"
tell process "Microsoft Excel"
keystroke return
delay 0.4
keystroke "c" using command down
delay 0.3
end tell
end tell
delay 0.3
tell application "Google Chrome" to activate
tell application "System Events"
tell process "Google Chrome"
keystroke "v" using command down
keystroke tab
end tell
end tell
delay 0.3
end repeat
希望这有帮助!