AppleScript lets you call most Objective-C APIs via a technology known as AppleScriptObjC. In Objective-C you might write this:
@import CoreWLAN;
CWWiFiClient * client = [CWWiFiClient sharedWiFiClient];
CWInterface * interface = client.interface;
NSSet<CWNetwork *> * networks = [interface scanForNetworksWithSSID:nil error:nil];
which looks like this in AppleScript:
use framework "CoreWLAN"
set client to current application's CWWiFiClient's sharedWiFiClient
set interface to client's interface
set networks to interface's scanForNetworksWithSSID:(missing value) |error|:(missing value)
The go-to reference for this is the Objective-C to AppleScript Quick Translation Guide appendix in the Mac Automation Scripting Guide.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"