AppleScript名:無線LANデバイスのMACアドレスを取得する |
— Created 2015-08-18 by Takaaki Naganoya — Created 2015-08-18 by Shane Stanley — 2015 Piyomaru Software use AppleScript version "2.4" use scripting additions use framework "Foundation" use framework "CoreWLAN" set aRes to retWiFiMACaddress() –> "XX:XX:XX:XX:XX:XX" –WiFi DeviceのMAC ADDRESSを返す on retWiFiMACaddress() –Get WLAN Device Name set allNames to current application’s CWInterface’s interfaceNames()’s allObjects() –> (NSArray) {"en0"} –@MacBook Pro Retina 2012 set hitF to false repeat with i from 1 to allNames’s |count|() set aInterface to (current application’s CWInterface’s interfaceWithName:(allNames’s objectAtIndex:(i – 1))) if aInterface’s serviceActive() as boolean then set hitF to true exit repeat end if end repeat if hitF = false then return false –There is No WiFi Device (Broken or illigal configuration or Hackintosh) set aHWAddress to aInterface’s hardwareAddress() as text –> "b8:xx:xx:xx:xx:xx"–MAC Address return aHWAddress end retWiFiMACaddress |
More from my site
(Visited 88 times, 1 visits today)