Is there a way to enable "Automatically hide and show menu bar" checkbox via applscript/osascript or just terminal?
Current OS: macOS Mojave 10.14
I read things like LSUIPresentationMode and tried different things with osascript already
Is there a way to enable "Automatically hide and show menu bar" checkbox via applscript/osascript or just terminal?
Current OS: macOS Mojave 10.14
I read things like LSUIPresentationMode and tried different things with osascript already
Code can be shorter on "MacOS Catalina" @2019-12 with "AppleScript Editor"
tell application "System Preferences" to reveal pane id "com.apple.preference.general"
tell application "System Events" to tell process "System Preferences" to tell window "General"
click checkbox "Automatically hide and show the menu bar"
end tell
quit application "System Preferences"
and you can run it from command line direct
printf 'tell application "System Preferences" to reveal pane id "com.apple.preference.general"\n tell application "System Events" to tell process "System Preferences" to tell window "General"\n click checkbox "Automatically hide and show the menu bar"\n end tell\n quit application "System Preferences"' | osascript
or from file
osascript {{script_name}}.scpt
thx @wch1zpink
If anyone is trying to do this in Monterey, I was able to modify the terminal command from @wch1zpink, and it works great.
printf 'tell application "System Preferences" to reveal pane id "com.apple.preference.dock"\n tell application "System Events" to tell process "System Preferences" to tell window "Dock & Menu Bar"\n click checkbox "Automatically hide and show the menu bar in full screen"\n end tell\n quit application "System Preferences"' | osascript
This AppleScript code should work for you
As per the request from a comment to my answer for the original post, this following code is a conversion from AppleScript to shell script… and can be run in the Terminal.app and should produce the same results