Issues pushing DNS servers into Network in 10.4.3 using GUI scripting

Having updated to 10.4.3 from 10.3.9, this script is no longer working. It’s a GUI script that allowed us to push the proper DNS servers and search domains in to the proper fields when iPass (a global dialer) clears them out. Any ideas why the script might not work any longer?

Thanks!

tell application “Finder”
activate
end tell

set DNSServer to “192.168.101,192.168.1.1”
set SearchDomain to “asia.mygreatdomain.com, na.mygreatdomain.com, intranet.mygreatdomain.com

tell application “System Preferences”
activate
set current pane to pane “com.apple.preference.network”
end tell
tell application “System Events”
if UI elements enabled then

	get properties
	tell process "System Preferences"
		tell window "Network"
			click pop up button 2
			click menu item "Internal Modem" of menu "OtherViews" of pop up button 1
			tell group 1
				tell tab group 1
					delay 1
					click radio button "TCP/IP"
					tell group 1
						set value of text field 1 to DNSServer
						delay 1
						set value of text field 2 to SearchDomain
					end tell
				end tell
			end tell
			click button "Apply Now"
			delay 1
		end tell
	end tell
	tell application "System Preferences"
		set current pane to pane "com.apple.preference.network"
		quit saving yes
	end tell
	
else
	
	tell application "System Preferences"
		activate
		set current pane to pane "com.apple.preference.universalaccess"
		display dialog "To run this script, UI element scripting must be enabled.  To enable UI element scripting, select the \"Enable access for assistive devices\" option."
	end tell
end if

end tell

Can you run the script in script editor and look at the event log. You can compare it with the one generated on a 10.3 machine. Where does the script run into trouble?

[log]
[snip]…[/snip]
click menu item “Internal Modem” of menu “OtherViews” of pop up button 1 of window “Network” of process
“System Preferences”
“System Events got an error:i NSReceiverEvaluationScriptError: 4”
[/log]

It opens the Network pane, chooses the “Show” menu and selects “Internal Modem” and then dies with the error noted above.

Hi
the last post works perfectly in 10.4.3! Very useful indeed!

Now, how would it be possible to unlock the network pane (if locked), by putting the admin/password in the same script ?
The ideal would be checking if the pane is locked - otherwise unlocking it, putting name/password in their fieds - then filling the DNS and search domains with the script.

I found something but it does not work and refers to tell process “SecurityAgent” and tell window “Authenticate”.

I would use it in both 10.3.9 and 10.4.3: would the code be different for the authentication?

Many thanks for your help
Ciao
Carlo