Skip to content

Instantly share code, notes, and snippets.

@codycodes
Last active January 9, 2019 11:41
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codycodes/2fb93e72fb827076f20bddccf1d6690b to your computer and use it in GitHub Desktop.
Save codycodes/2fb93e72fb827076f20bddccf1d6690b to your computer and use it in GitHub Desktop.
-- Toggle "Automatically hide and show the menu bar option using UI" -- Useful for when you want to maximize your screen real estate :) -- Please comment if you have any suggestions for improvements!
-- Toggle "Automatically hide and show the menu bar option using UI"
-- Useful for when you want to maximize your screen real estate :)
-- Please comment if you have any suggestions for improvements!
tell application "System Preferences"
activate
set current pane to pane id "com.apple.preference.General"
tell application "System Events"
delay 1
tell process "System Preferences"
set boxToCheck to "Automatically hide and show the menu bar"
if (exists checkbox boxToCheck of window 1) is true then
click checkbox boxToCheck of window 1
tell application "System Preferences" to quit
end if
end tell
end tell
end tell
@codycodes
Copy link
Author

I use BTT to use this script and maximize the window after as an additional action so that you don't have to do that manually.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment