所以我的问题是在磁盘战士的“目录”窗格下有一个下拉窗口,我无法将“AppleScript”变为“点击”。无论如何要告诉applescript“点击”下拉窗口,然后单击列表中的磁盘?我的boSS想要整个代码自动化,这是我不确定我是否可以自动化的一部分。这是我的代码:
do shell script "open /Applications/DiskWarrior.app"
delay 3
tell application "System Events"
keystroke "my password"
delay 2
keystroke return
delay 3
keystroke tab
delay 3
keystroke return
delay 20
--Delay 20 to allow time for the application to fully load
end tell
在diskwarrior打开后,下一步将选择我想要重建的磁盘,但正如我所说,我不确定如何告诉AppleScript“点击”它。
有人有什么建议吗?
答案 0 :(得分:1)
do shell script "open -a DiskWarrior"
delay 5
tell application "System Events"
tell process "SecurityAgent"
set value of text field 2 of scroll area 1 of group 1 of window 1 to "password"
click button 2 of group 2 of window 1
end tell
delay 5
tell process "DiskWarrior"
set frontmost to true
tell pop up button 1 of window 1
click
click menu item 2 of menu 1
end tell
set visible to false -- workaround for a glitch in the DiskWarrior UI
set visible to true
click button "Rebuild" of window 1
end tell
end tell
我无法点击重建按钮。然而,Automator中的录制操作有效: