Compact AirPods widget with User-Friendly Setup

I did, but it still didn't seem to work for me. I also tried [A better AirPod Connection] Widget and your [C2] widget. It somehow didn't work too, so now I'm confused if it comes from my mac, airpods or what haha.

Ok, this is strange. You also changer the Script in the Associated Action I guess?

It might be language or the ‘

I’m afraid I can’t be of much help though, as I can’t test things.

But two things to look for:

Is it toggling the connection?
Is it displaying the right thing?

If it’s toggling the connection properly then we know that the name should be working, but the display script is stuffing up...

@Bluetus
It seems you’ve edited the code and inserted the names into it. maybe try delete and reinstall?

The second screenshot seems to be the "classic" two lines Widget from my preset, where you had to individualize the code with the names.

There he just needs to be sure that he added all three locations of his name.
But @yuuiko got the most important point there, what do you mean with "it's not working"? The battery info is not shown, or the AirPods won't connect?

JUST DISCOVERED WHAT WAS MESSING AROUND WITH US

And it's f4cking stupid
 :flushed:
We just didn't consider that you might have another system language and coded everything for English menus.
So, here is the walkthrough to fix it for you:

  1. Get to the widget, and open the Predefined Action Script.
  2. Scroll down until you see " activate application "SystemUIServer" " line. In this paragraph, change the two "Connect" to what is written in the Bluetooth menu in your System Language when you want to connect your AirPods (Bluetooth menu → Your AirPods → the button to connect them. In French, this should be "Connecter", it is the button at the very top).
  3. In the same paragraph, change the "Disconnect" to what is written in the Bluetooth menu in your System Language when you want to disconnect your AirPods (Bluetooth menu → Your AirPods → the button to connect them. In French, this should be "DĂ©connecter", it is the button at the very top).

    Hit "save" and it should work now!

In a short time, I'll try to give a fix for the icon that changes as soon as any Bluetooth device is connected.
@yuuiko this seems to be due to this line:


I won't have the time to fix this today, but I'll hunt this one down tomorrow or so.

Also, (back to topic), I found this topic that explains how to get the NSLocalizedString with Apple Script. I will try to figure out how to use this in our case, but I do not promise anything for now
 :wink:

@Bluetus

:wink:

1 Like

Ups :ghost:

Thank you so much for the solution for, but unfortunately, It still doesn't seem like to be the case for me because I use English as a system language.

And to explain more how it doesn't work, on this [Compact AirPods Widget], after I put the name, it'll show "success" icon like a half second before it turns grey again like the pic I show below

v
v
v

The left one is from [Compact AirPods Widget]
The right one is from [C2]

OMG... I use a universal clipboard to copy the name of my AirPods from the iPhone to make sure it has the exact same name, and it WORKS NOW !!!!

It is so beautiful ~~~~

Thanks you @Caliguvara and @yuuiko so much, I feel so dumb now

2 Likes

@Bluetus Glad you got that working!

Could you send the names you tried and then the name that worked?

An error window should pop up informing you of the error but it didn’t seem to appear for you. Or did it?

If it didn’t then I have something to fixup :wink:

I used "Bluetus's AirPod" in my Mac, and it doesn't work
because the real name is "Bluetus’s iPhone"

Yes, after failed to connect, it has no error box,
and on the touch bar it just turns grey like the AirPods doesn't connect,
but if I try to tap the icon again on my touch bar
It will show that you could not find your AirPods box and ask me to restart the widget.
I'm not sure if that the expected behavior or the error box should show right after the widget can't find my AirPods.

@yuuiko

1 Like

@Caliguvara @GoldenChaos

Linked to:

1 Like

Fixed the icon that changed as soon as any other BT device was connected

Remember when it always looked like this as soon as any device was connected?


It seems to me that the lines

[
]
repeat numberOfDevices times --loop through each devices checking for Connected string 
    if item counter of myList contains LclAirPodsName then
        if item counter of myList contains "Connected: Yes" then
            return checkBattery()
        else if item counter of myList contains "Connected: No" then
            return " "
[
]

Create a loop that causes the checkBattery to run as soon as any device of the list returned a "Connected: Yes".
I didn't find a solution to fix that.

So I ended up checking the output of the checkBattery, and if its output is just a return, I'd actually return just space, in order to change the script's icon to "not connected".
The end of the script looks like this now:

It works perfectly fine, but there might be a "smoother" solution for it?

Here the corrected .json
AirPods Widget.json (67.1 KB)

1 Like

@Caliguvara did you change any variable or named trigger connections? I'm compiling a preset to post in the top post.

Nope, just the end of the script, the highlighted part :wink:
Went from "return...."
To "set....if....return.. etc"

So, uh, this is weird, but I haven't been able to connect my AirPods to my Mac at all over the last few weeks. I've tried so many troubleshooting steps, but my Mac is, for some reason, refusing the make the AirPods the audio output. They connect via Bluetooth just fine, but macOS chokes when trying to switch to it as the audio output.

This is why I haven't been able to test anything here yet.

I've tried everything short of uninstalling some of my critical audio apps. I'm kind of hoping it's just a macOS beta issue, because I seem to recall it only popping up when the last Mojave beta went out.

I had to re-pair them recently to make them work again. Also resetting the bluetooth module sometimes helps (hold cmd+option while clicking the bluetooth menu in the menubar, then use the debug menu)

//edit: sorry: shift+option

The weird issue is that they connect. If you look at the Bluetooth menu, they're connected. The system then tries to switch to the AirPods as the audio output (you can tell this because the volume icon in the menu bar pulses back and forth). After about 30 seconds it will fail and revert to the previous audio output.

Unpairing/repairing and resetting the BT module haven't helped because the issue doesn't seem to be with the connection.

I had a similar issue when I still had my LG 5k Ultrafine monitor that had some electrical shielding issues - it broke the Airpods but they still showed up as connected in the Bluetooth menu.

Oof, I have only tried to connect my AirPods within proximity to an UltraFine 5K... I sure hope that isn't the cause. My secondary machine isn't connected to an UltraFine, so I'll see if my AirPods can connect to it in just a sec. Then, if it works, it should be a matter of figuring out what the configuration difference between my two machines is.