1

I've tested the code below (from another question) and indeed it works fine, but I have minor problem with it. As my two SSIDs are called "kat" and "kat2", the expression "starts with" won't work for me. I tried to replace it with "equals" or "ends with" but for these two options I get the result "missing value".

Any thoughts?

From URL: Big Sur 11.1: AppleScript to Automatically Change Wi-Fi Networks

tell application "System Events" to click every menu bar item of menu bar 1 of application process "ControlCenter" whose title starts with "Wi‑Fi"
tell application "System Events" to click every UI element of scroll area of group 1 of window "Control Center" of application process "ControlCenter" whose title starts with "YOUR_SSID_HERE"
1
  • whose title is equal to "YOUR_SSID_HERE" works for me in macOS Catalina, but cannot test in macOS Big Sur at this time. May 6, 2021 at 2:54

1 Answer 1

1

It seems I've found the problem. The issue is that the selection of the element, rather than returning "kat", it returns "kat, secure network, 2 bars" and that is why "ends with" or "equals" does not work. To fix that I can use "starts with" but adding a comma after YOUR_SSID_HERE.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .