Spoons
Spoons copied to clipboard
PersonalHotspot spoon does not work on macOS 12
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.
I'll have a look into this on the weekend.
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.