hammerspoon2-docs
    Preparing search index...

    Function associate

    • Scans for a network by SSID and joins it. Enterprise networks are not supported. This can take several seconds; it runs off the main thread so it does not block the app.

      Parameters

      • ssid: string

        the SSID of the network to join

      • Optionalpassphrase: string | null

        the network passphrase; required for WEP/WPA/WPA2/WPA3 Personal networks

      • Optionalinterface: string | null

        the interface name as returned by interfaces(); omit for the system's default Wi-Fi interface

      Returns Promise<boolean>

      A Promise that resolves true if joined successfully, false if no network with that SSID was found, or rejects if the interface doesn't exist or the association attempt fails