我对这个苹果脚本有疑问。错误 1719。 仪器应用程序 我需要将新的滑块值设置为 2。
这是我的代码:
tell application "Instruments"
activate
end tell
activate application "Instruments"
tell application "System Events"
tell process "Instruments"
keystroke "," using command down --Instruments menubar -> Preferences
tell window 1
click button "CPUs" of toolbar 1
set value of slider 1 of group 1 to 2
end tell
end tell
end tell
感谢您的帮助
这是一个参考错误。
滑块位于
group 1 of group 1
。使用 GUI 脚本时,还建议等待特定的 UI 元素,以防出现时间紧迫的更改。
activate application "Instruments"
tell application "System Events"
tell process "Instruments"
keystroke "," using command down --Instruments menubar -> Preferences
tell window 1
click button "CPUs" of toolbar 1
tell group 1 of group 1
repeat until exists slider 1
delay 0.2
end repeat
set value of slider 1 to 2
end tell
end tell
end tell
end tell
使用 GUI 脚本时,还建议等待特定的 UI 元素,以防出现时间紧迫的更改。
魔法。谢谢你。