How to connect your AirPods with your Mac using a keyboard shortcut

AirPods Pro

AirPods are good headphones, there is no doubt. It does not matter whether they are the normal ones or the Pro ones. One of the best qualities is the simplicity of pairing with Apple devices. But when you want to switch from one to another, iPhone to Mac for example, it is a bit tedious to re-link them. You can improve this process with a keyboard shortcut created on the computer.

We can improve the way to transfer the AirPods from a device to the Mac, with a simple keyboard shortcut.

The first time you connect the AirPods to the Mac it is very fast. But if I later want to use the iPhone or iPad, and return to the Mac, the process takes longer. Now, you have to click on the bluetooth menu and connect them manually. This every time I switch devices. It's a bit of a bummer. It can improve.

We are going to use the Script that Andrew Burns created and use a keyboard shortcut. The first thing is to open AppleScript and then we paste the mentioned code which is the following. Remember that you must change where it says SX-991 and put the name of your AirPods, exactly the same as how it is written, without changing one iota.

activate application "SystemUIServer"
tell application "System Events"
  tell process "SystemUIServer"
    -- Working CONNECT Script.  Goes through the following:
    -- Clicks on Bluetooth Menu (OSX Top Menu Bar)
    --    => Clicks on SX-991 Item
    --      => Clicks on Connect Item
    set btMenu to (menu bar item 1 of menu bar 1 whose description contains "bluetooth")
    tell btMenu
      click
      tell (menu item "SX-991" of menu 1)
        click
        if exists menu item "Connect" of menu 1 then
          click menu item "Connect" of menu 1
          return "Connecting..."
        else
          click btMenu -- Close main BT drop down if Connect wasn't present
          return "Connect menu was not found, are you already connected?"
        end if
      end tell
    end tell
  end tell
end tell

Once you finish you must save what has been done as an Application. We are not done yet. At the moment it does not work. We have to carry out the following action, to give that application permission to control the Mac.

  1. Let's go to "Security and privacy" in System preferences
  2. We do click on the padlock  to make changes.
  3. Choose "Accessibility»In the list of items on the left.
  4. We press the small button +
  5. Search your app and add it

Yes now. We are going to create the keyboard shortcut to make it work quickly. For this we help ourselves with a external program to help us do it. We recommend, for example, Snap. Little difficulty in performing the desired work.


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   Gustavo Rodriguez said

    Hi Manuel, I tried but it doesn't work for me when I run the script, this opens the menu but it is as if it did not apply the connection action.
    What I can do ?
    I am doing it on macOS Catalina

    Thank you

  2.   Alejandro said

    Hi, check if you have the system in Spanish or English ...

    I had to correct the script and change Connect to Connect