因为要频繁地 Toggle MenuBar 和 Dock 的隐藏和显示
在 System preference 手动设置太麻烦还费时间
所以第一次研究了 Script Editor
效果:

下载:
https://img.fuckb.at/files/share/autoHideNShow.zip
当然应该很少有人有像我这样的场景,可以根据自己的情况编写若干个设置的快捷方式
打开Script Editor
创建新文档
复制以下代码
tell application "System Preferences"
reveal pane id "com.apple.preference.general"
end tell
tell application "System Events" to tell process "System Preferences" to tell window "General"
click checkbox "Automatically hide and show the menu bar"
end tell
delay 1
tell application "System Preferences"
reveal pane id "com.apple.preference.dock"
end tell
tell application "System Events" to tell process "System Preferences" to tell window "Dock"
click checkbox "Automatically hide and show the Dock"
end tell
quit application "System Preferences"
以 Application 的形式保存
可以将它放到 Dock 里
第一次点击时允许访问 'Assistive apps to controll...'
这样就可以点击一下就可以来回切换是否要现实或自动隐藏 Menubar 和 Dock 了
也许有更好的实现方式,欢迎指点