Selection of Wi-Fi using AppleScript in Big Sur 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 &quot;kat&quot; and &quot;kat2&quot;, the expression &quot;starts with&quot; won't work for me.  I tried to replace it with &quot;equals&quot; or &quot;ends with&quot; but for these two options I get the result &quot;missing value&quot;.
Any thoughts?
From URL: Big Sur 11.1: AppleScript to Automatically Change Wi-Fi Networks
tell application &quot;System Events&quot; to click every menu bar item of menu bar 1 of application process &quot;ControlCenter&quot; whose title starts with &quot;Wi‑Fi&quot;
tell application &quot;System Events&quot; to click every UI element of scroll area of group 1 of window &quot;Control Center&quot; of application process &quot;ControlCenter&quot; whose title starts with &quot;YOUR_SSID_HERE&quot;
It seems I've found the problem. The issue is that the selection of the element, rather than returning &quot;kat&quot;, it returns &quot;kat, secure network, 2 bars&quot; and that is why &quot;ends with&quot; or &quot;equals&quot; does not work. To fix that I can use &quot;starts with&quot; but adding a comma after YOUR_SSID_HERE.