How do I turn Airport power on and off with AS in OSX? I've tried various variations of:
tell application "Internet Connect" get item whose class is AirPort configuration of (every configuration) end tell
(and then I'll set the power property) which don't work. I can pull out a configuration by name, but the name of the Airport configuration is not necessarily "Airport". Can I pull out a single configuration short of a repeat loop like this:
tell application "Internet Connect" set tConfigs to (every configuration) repeat with i from 1 to number of items in tConfigs set pConfig to (item i of tConfigs) if class of pConfig is AirPort configuration then --display dialog i set AirPort power of pConfig to false end if end repeat end tell
Even this doesn't work (NSInternalScriptError). And is there a way to supress the automatic opening of the application when any tell block is entered?
Thanks, Jim |