Toggle Menu Bar Visibility by Double Tapping the Menu Bar

Hello!

Here is a really small preset but it is super useful. When you double tap the Menu Bar, it toggles the Menu Bar's visibility.

You can copy the following text and paste it in Automations & Named & Other Triggers

[
  {
    "BTTLastUpdatedAt" : 1693879361.737792,
    "BTTTriggerType" : 613,
    "BTTTriggerTypeDescription" : "Doubleclick Main Menubar",
    "BTTTriggerClass" : "BTTTriggerTypeOtherTriggers",
    "BTTPredefinedActionType" : 195,
    "BTTPredefinedActionName" : "Run Apple Script (async in background)",
    "BTTGenericActionConfig" : "# https:\/\/jessicadeen.com\/posts\/2020\/show-hide-menubar-big-sur\/\ntell application \"System Events\"\n    tell dock preferences to set autohide menu bar to not autohide menu bar\nend tell",
    "BTTInlineAppleScript" : "# https:\/\/jessicadeen.com\/posts\/2020\/show-hide-menubar-big-sur\/\ntell application \"System Events\"\n    tell dock preferences to set autohide menu bar to not autohide menu bar\nend tell",
    "BTTUUID" : "BB8C2048-419F-42D4-B09A-A61CF6044C11",
    "BTTEnabled" : 1,
    "BTTEnabled2" : 1,
    "BTTOrder" : 15,
    "BTTGestureNotes" : "Doubleclick Main Menubar"
  }
]

Or you can import the preset here:
DoubleTapMenuBarToggleVisibility_v1.bttpreset (1.8 KB)

If you enjoy this preset or any of my others - please consider donating: PayPal.Me

And always - thanks for checking out my preset! :blush:

-Josh

Change Log:
v1 DoubleTapMenuBarToggleVisibility_v1.bttpreset (1.8 KB)

  • Initial Build

Where do we paste it? What's the trigger?

Can you give any more details about how to actually implement this? Thanks!


In the meantime, for anyone wondering, here's how I got it working:

  1. Open BTT configuration and press cmd+9 (or otherwise navigate to the Automations & Named & Other Triggers section, it's in the dropdown with Normal Mouse, Keyboard Shortcuts, etc.).

  2. Add a trigger for Doubleclick Main Menubar.

  3. Assign an action Run Apple Script (async in background).

  4. THE SCRIPT

What the script does is relatively self-explanatory, but it's best practice to check with ChatGPT when you find random code on the internet. I've done that for you here: Toggle Menu Bar Auto-Hide

When you're satisfied that it's safe, copy it from the ChatGPT conversation, or from below, and paste it in the big whitge script field on the right side.

tell application "System Events"
    tell dock preferences to set autohide menu bar to not autohide menu bar
end tell
  1. Save it, and the action should begin working as expected.
1 Like

Thanks for clarifying @SerenePancake
When I try this BTT keeps toggling back to "Source Type: Apple Script From SCPT File" after I click into "Source Type: Apple Script" and paste in the script. Anything Im missing?

••Edit its a bug

Just used this to create a keyboard shortcut to hide/show menu - thx!

1 Like

Hi all - sorry for the confusion - but I am glad you guys were able to get it working :slight_smile:

In the OP, you should be able to copy that blob of JSON and paste it under Automations & Named & Other Triggers and it will add all this for you (or can import the preset)

Here is what it looks like:

And here is the script:

# https://jessicadeen.com/posts/2020/show-hide-menubar-big-sur/
tell application "System Events"
    tell dock preferences to set autohide menu bar to not autohide menu bar
end tell