AppleScript名:WiFiデバイスのパワーをオンに |
— Created 2015-08-18 by Shane Stanley — Modified 2015-08-18 by Takaaki Naganoya use AppleScript version "2.4" use scripting additions use framework "Foundation" use framework "CoreWLAN" set wRes to powerOnEveryWiFiDevices() of me on powerOnEveryWiFiDevices() set allNames to current application’s CWInterface’s interfaceNames()’s allObjects() as list if allNames = {} then return false set powerList to {} repeat with i in allNames set j to contents of i set aInterface to (current application’s CWInterface’s interfaceWithName:j) set wRes to (aInterface’s setPower:true |error|:(missing value)) set aPower to (aInterface’s powerOn()) as boolean if aPower = false then display notification "Error occured in enabling an Wifi deviece ( " & j & " )…." end if set the end of powerList to aPower end repeat return ({true} is in powerList) –return whether some WiFi interface is on end powerOnEveryWiFiDevices |
More from my site
(Visited 51 times, 1 visits today)