我的系统版本为Monterey 12.5.1,亲测有效
直接创建脚本xxx.sh,并在终端执行脚本bash xxx.sh
即可解决此问题,脚本内容如下:
sh
#!/bin/bash
killall Finder #kill Finder如不需要可以删除
killall Dock #kill Dock 如不需要可以删除
#开始---模拟实现关开一次放大和缩小 如不需要可以删除
osascript <<EOD
tell application "System Preferences"
if it is running then
quit
delay 0.6
end if
end tell
tell application "System Preferences"
reveal anchor "trackpadTab" of pane id "com.apple.preference.trackpad"
end tell
tell application "System Events" to tell process "System Preferences"
click radio button 2 of tab group 1 of window 1
click checkbox 2 of tab group 1 of window 1
click checkbox 2 of tab group 1 of window 1
end tell
quit application "System Preferences"
EOD
#结束---模拟实现关开一次放大和缩小 如不需要可以删除