如何使用 AppleScript 切换 "reduce motion" 首选项?
How to toggle "reduce motion" preference with AppleScript?
我希望能够通过类似于此 article about toggling dark mode 的触摸栏切换 macOS "reduce motion" 首选项(系统首选项 > 辅助功能 > 显示 > 显示 > 减少运动)关于如何使用 AppleScript 切换它的想法?我在谷歌上搜索了一下,但一无所获。
此 AppleScript 代码适用于使用最新版本的 macOS Catalina 的我
if application "System Preferences" is running then ¬
do shell script "killall 'System Preferences'"
repeat until application "System Preferences" is not running
delay 0.1
end repeat
tell application "System Preferences"
reveal anchor "Seeing_Display" of ¬
pane id "com.apple.preference.universalaccess"
end tell
tell application "System Events"
repeat until exists of checkbox "Reduce motion" of tab group 1 of ¬
group 1 of window "Accessibility" of application process "System Preferences"
delay 0.1
end repeat
click checkbox "Reduce motion" of tab group 1 of ¬
group 1 of window "Accessibility" of application process "System Preferences"
end tell
tell application "System Preferences" to quit
我希望能够通过类似于此 article about toggling dark mode 的触摸栏切换 macOS "reduce motion" 首选项(系统首选项 > 辅助功能 > 显示 > 显示 > 减少运动)关于如何使用 AppleScript 切换它的想法?我在谷歌上搜索了一下,但一无所获。
此 AppleScript 代码适用于使用最新版本的 macOS Catalina 的我
if application "System Preferences" is running then ¬
do shell script "killall 'System Preferences'"
repeat until application "System Preferences" is not running
delay 0.1
end repeat
tell application "System Preferences"
reveal anchor "Seeing_Display" of ¬
pane id "com.apple.preference.universalaccess"
end tell
tell application "System Events"
repeat until exists of checkbox "Reduce motion" of tab group 1 of ¬
group 1 of window "Accessibility" of application process "System Preferences"
delay 0.1
end repeat
click checkbox "Reduce motion" of tab group 1 of ¬
group 1 of window "Accessibility" of application process "System Preferences"
end tell
tell application "System Preferences" to quit