Programmatically Obtain Recent Wi-Fi Networks On A Mac

When you join a wireless network on a Mac, the information for that network is cached into the property list. You can access this information using the following command, constraining output to the LastConnected field and the next 7 lines: defaults read /Library/Preferences/SystemConfiguration/ | grep LastConnected -A 7