Spoons icon indicating copy to clipboard operation
Spoons copied to clipboard

PersonalHotspot spoon does not work on macOS 12

Open dschuessler opened this issue 2 years ago • 2 comments

The following sample code does nothing:

spoon.SpoonInstall:andUse(
  "PersonalHotspot",
  {
    config = {
      hotspotName = "iPhone",
    },
  }
)

spoon.PersonalHotspot:connect()

I had a look into the spoon's code and it is apparently supposed to open the Wi-Fi menu bar item and click on the entry. When I copy the relevant Javascript code over to macOS' script editor, it already fails to fetch the menu bar item:

Error: TypeError: undefined is not an object (evaluating 'wifiMenuBarItem.menus')

This might be a result of somewhat recent macOS updates. I can't find an easy solution right away but I leave this here for reference, in case I get around having a closer look.

dschuessler avatar Aug 08 '22 13:08 dschuessler

I'll have a look into this on the weekend.

malob avatar Aug 09 '22 19:08 malob

When I tried to fix it myself, I stumbled over a great writeup about scripting the menu bar in Big Sur by @geofftaylor.

Ultimately, I didn't succeed. (UI Browser fails to break down the UI item hierarchy of the Wi-Fi menu, at least on my machine with macOS 12.) But I leave it here in case it helps.

dschuessler avatar Aug 09 '22 20:08 dschuessler