Hello,
It's interesting to use Script Debugger to find stuff that is obscure. In trying to script turning on an HTTP proxy WITHOUT using GUI scripting, I was able to get as far as locating the "Proxies" tab, which is called an "Anchor" in what Script Debugger tells me. It also tells me that the "Anchor" object responds to the "reveal" verb.
So this works, and avoids the GUI scripting to get to the Anchor:
tell application "System Preferences" to reveal anchor "Proxies" of pane "Network" --works fine; opens the Network pane to the Proxies page
and this shows all the names of the anchors:
tell application "System Preferences" name of anchors of pane "Network" end tell
=> { "Ethernet", "Modem", "Proxies", "AppleTalk", "TCP/IP", "Network", "PPP", "BlueTooth", "PPPoE", "AirPort" }
However, I can't seem to do anything else with the "Anchor" object. I've gotten the script to work just fine by adding some GUI scripting to select the second row ("Web Proxy (HTTP)") and click its checkbox, and then click the Apply Now button, so there is no problem getting the script to work; but I am curious if there is any way to tell the Anchor what to do, or if there is a shell script that can simply set the proxy. Just curious, that's all.
Sincerely,
R. Harold Holbrook Jr., M.D. |