Applescript 如何在任务控制中设置复选框?
我正在尝试在“系统首选项”的“任务控制”窗格中设置复选框。到目前为止,我能够打开MC,但我不知道如何点击复选框。我在网上找到的所有东西都试过了,但没有成功。。。 我怎么做 告诉应用程序“系统首选项”激活将当前窗格设置为 窗格“com.apple.preference.expose”结束Applescript 如何在任务控制中设置复选框?,applescript,Applescript,我正在尝试在“系统首选项”的“任务控制”窗格中设置复选框。到目前为止,我能够打开MC,但我不知道如何点击复选框。我在网上找到的所有东西都试过了,但没有成功。。。 我怎么做 告诉应用程序“系统首选项”激活将当前窗格设置为 窗格“com.apple.preference.expose”结束 仅当当前未选中窗格的第一个复选框时,才会单击该复选框: tell application "System Preferences" set current pane to pane "com.apple.
仅当当前未选中窗格的第一个复选框时,才会单击该复选框:
tell application "System Preferences"
set current pane to pane "com.apple.preference.expose"
activate
end tell
tell application "System Events"
tell process "System Preferences"
set firstCheckbox to checkbox 1 of group 2 of window 1
set checked to value of firstCheckbox as boolean
if (not checked) then
click firstCheckbox
end if
end tell
end tell
仅当当前未选中窗格的第一个复选框时,才会单击该复选框:
tell application "System Preferences"
set current pane to pane "com.apple.preference.expose"
activate
end tell
tell application "System Events"
tell process "System Preferences"
set firstCheckbox to checkbox 1 of group 2 of window 1
set checked to value of firstCheckbox as boolean
if (not checked) then
click firstCheckbox
end if
end tell
end tell