Is it possible to change proxy settings without using UI Scripting?
cirno,
It seems there is.
There’s a command line program scselect
do shell script "/usr/sbin/scselect 'location'"
scselect without parameters returns the list of locations and indicates the active one. I tried putting the return results in a variable without success. I got an AppleScript runtime error. Then you could have a dialog where you could choose or you could have the script switch between 2. Maybe someoe can help further.
Gary
Hi Gary,
at least in Tiger, "/usr/sbin/ " is not necessary, just “scselect” is sufficient.
You can get a list with all available network locations with
set NetworkLocations to do shell script "scselect 2>&1 | grep '^ ' 2>&1 | cut -f 2 -d '(' | cut -f 1 -d ')'"
Hi cirno,
as Gary wrote,
changing location with built-in command line scselect is the most elegant solution
Thanks, but i’m trying to find solution without changing location.