Mac Plist relevance for WiFi SSID

I want to see if a Mac has every joined a particular wireless network by looking at the SSIDs. I can look at a particular key in a plist, but I can’t get the dictionaries inspector to work, and maybe I’m just holding it wrong.

This works, but the wifi identifier is a random ID (just keeping it to demonstrate functionality).
Q: data "SSIDString" of dictionary "wifi.ssid.<65647572 6f616d>" of dictionary "KnownNetworks" of dictionaries of file "/Library/Preferences/SystemConfiguration/" A: eduroam

This does not:
Q: datas "SSIDString" of dictionaries of dictionary "KnownNetworks" of dictionaries of file "/Library/Preferences/SystemConfiguration/" E: The operator "dictionaries" is not defined.

The plist looks like this (truncated):
<dict> <key>Counter</key> <integer>2</integer> <key>KnownNetworks</key> <dict> <key>wifi.ssid.&lt;4d6f6e6b 65794661 6365&gt;</key> <dict> <key>SSIDString</key> <string>Kittens</string> </dict> <key>wifi.ssid.&lt;65647572 6f616d&gt;</key> <dict> <key>SSIDString</key> <string>eduroam</string> </dict> <key>wifi.ssid.&lt;526f7365 2d35475f 32474558 54&gt;</key> <dict> <key>SSIDString</key> <string>Puppies</string> </dict> </dict> </dict>

I can list these keys/dictionaries, but not directly:
Q: keys of dictionary "KnownNetworks" of dictionaries of file "/Library/Preferences/SystemConfiguration/" A: wifi.ssid.<526f7365 2d35475f 32474558 54> A: wifi.ssid.<65647572 6f616d> A: wifi.ssid.<4d6f6e6b 65794661 6365>

Try this:

Or this:

strings "SSIDString" of dictionaries of values of entries of dictionaries "KnownNetworks" of dictionaries of files "/Library/Preferences/SystemConfiguration/"

I’d say this is probably some of the hardest kinds of relevance to write. @rustymyers @hansen_m and I spent many weeks struggling with plist relevance, and even now it is difficult to write without looking at my previous work.

I’d love it if I could read a plist using Xpath instead, but that is likely not available natively on OS X. ( @AlanM )

That worked perfectly, thank you!

1 Like

That helped me make a relevance for Macs too

1 Like

Yeah its not available yet :frowning:

1 Like