accessibility – Ventura: AppleScript to Routinely Change Wi-Fi Networks

accessibility – Ventura: AppleScript to Routinely Change Wi-Fi Networks


It is a follow-up to a put up made about 2 years in the past to make use of Apple Script to change between Wi-Fi networks by way of the menu bar:

Massive Sur 11.1: AppleScript to Routinely Change Wi-Fi Networks

My previously-working script now simply returns “lacking worth”:

inform utility "System Occasions" to click on (each menu bar merchandise of menu bar 1 of utility course of "ControlCenter" whose title begins with "Wi‑Fi")
inform utility "System Occasions" to click on (each UI factor of scroll space of group 1 of window "Management Heart" of utility course of "ControlCenter" whose title begins with "YOUR_SSID_HERE")

It appears macOS Ventura broke my beforehand answer fairly badly. I am unable to even use “get properties” to make any sense of of what the hierarchy of UI parts must be anymore. Eg:

inform utility "System Occasions" to click on (each menu bar merchandise of menu bar 1 of utility course of "Management Heart" whose description begins with "Wi‑Fi")
delay 3
inform utility "System Occasions" to get properties of UI parts of scroll space 1 of group 1 of window "Management Heart" of utility course of "Management Heart"

Outcome:

{{minimal worth:lacking worth, orientation:lacking worth, place:{2061, 76}, class:UI factor, accessibility description:lacking worth, function description:"heading", centered:lacking worth, title:lacking worth, measurement:{102, 15}, assist:lacking worth, total contents:{}, enabled:true, most worth:lacking worth, function:"AXHeading", worth:lacking worth, subrole:lacking worth, chosen:lacking worth, title:lacking worth, description:"heading"}, {minimal worth:lacking worth, orientation:lacking worth, place:{2052, 95}, class:checkbox, accessibility description:lacking worth, function description:"toggle button", centered:lacking worth, title:lacking worth, measurement:{288, 32}, assist:lacking worth, total contents:{}, enabled:true, most worth:lacking worth, function:"AXCheckBox", worth:0, subrole:"AXToggle", chosen:lacking worth, title:lacking worth, description:"toggle button"}, {minimal worth:lacking worth, orientation:lacking worth, place:{2061, 141}, class:UI factor, accessibility description:lacking worth, function description:"heading", centered:lacking worth, title:lacking worth, measurement:{99, 15}, assist:lacking worth, total contents:{}, enabled:true, most worth:lacking worth, function:"AXHeading", worth:lacking worth, subrole:lacking worth, chosen:lacking worth, title:lacking worth, description:"heading"}, {minimal worth:lacking worth, orientation:lacking worth, place:{2052, 160}, class:checkbox, accessibility description:lacking worth, function description:"toggle button", centered:lacking worth, title:lacking worth, measurement:{288, 32}, assist:lacking worth, total contents:{}, enabled:true, most worth:lacking worth, function:"AXCheckBox", worth:0, subrole:"AXToggle", chosen:lacking worth, title:lacking worth, description:"toggle button"}, {minimal worth:lacking worth, orientation:lacking worth, place:{2052, 192}, class:checkbox, accessibility description:lacking worth, function description:"toggle button", centered:lacking worth, title:lacking worth, measurement:{288, 32}, assist:lacking worth, total contents:{}, enabled:true, most worth:lacking worth, function:"AXCheckBox", worth:1, subrole:"AXToggle", chosen:lacking worth, title:lacking worth, description:"toggle button"}, {minimal worth:lacking worth, orientation:lacking worth, place:{2052, 224}, class:checkbox, accessibility description:lacking worth, function description:"toggle button", centered:lacking worth, title:lacking worth, measurement:{288, 32}, assist:lacking worth, total contents:{}, enabled:true, most worth:lacking worth, function:"AXCheckBox", worth:0, subrole:"AXToggle", chosen:lacking worth, title:lacking worth, description:"toggle button"}, {minimal worth:lacking worth, orientation:lacking worth, place:{2052, 267}, class:UI factor, accessibility description:lacking worth, function description:"disclosure triangle", centered:false, title:lacking worth, measurement:{288, 22}, assist:lacking worth, total contents:{}, enabled:true, most worth:lacking worth, function:"AXDisclosureTriangle", worth:0, subrole:lacking worth, chosen:lacking worth, title:lacking worth, description:"disclosure triangle"}}

That is complete gibberish to me and does not checklist any clear UI parts with any title or description attributes that time to a selected Wi-Fi SSID. I additionally discover a ton of “lacking worth” strings. By comparability, utilizing Accessibility Inspector and clicking on my desired SSID within the community checklist, it claims it has the under attributes:


 
  
   
    

Attributes:
   AXParent:  “”
   AXRoleDescription:  “toggle button”
   AXChildren:  “”
   AXIdentifier:  “wifi-network-MYSSID”
   AXPath:  “Path 0x600003016d90:
  ”
   AXAttributedDescription:  “MYSSID, safe community, 3 bars{
    AXATextAlignmentValue = 0;
    AXFont =     {
        AXFontFamily = ".AppleSystemUIFont";
        AXFontName = ".SFNS-Common";
        AXFontSize = 13;
        AXVisibleName = "System Font Common";
    };
    AXForegroundColor =  [ (kCGColorSpaceICCBased; kCGColorSpaceModelRGB; Generic RGB Profile)] ( 0 0 0 0.847059 );
}”
   AXEnabled:  “1”
   AXSubrole:  “AXToggle”
   AXRole:  “AXCheckBox”
   AXWindow:  “”
   AXValue:  “1”
   AXChildrenInNavigationOrder:  “”

Actions:
   AXPress - press

I am actually actually stumped right here and have been making an attempt to work on this for hours. I simply can’t for the lifetime of me work out which baby factor inside “scroll space 1” I must be utilizing. Any concepts?

Thanks.

Leave a Reply

Your email address will not be published. Required fields are marked *