script for leopard bug

There is a bug in Leopard where I can only connect to my wireless network if I use the network diagnostics tool and put “0x” in front of my WEP passowrd. I have filed a bug report and I encourage other who are having this problem to do the same.

so at any rate I’ve been trying to GUI script the process (Blah!!! if there is a better way please let me know.) but I can’t get it to select the network

here is what I have so far


tell application "System Preferences"
	activate
	set current pane to pane "Network"
end tell
tell application "System Events"
	
	tell process "System Preferences"
		set frontmost to true
		tell window 1
			click button "Assist me."
			click button "Diagnostics." of sheet 1
		end tell
	end tell
	
	tell process "Network Diagnostics"
		
		set frontmost to true
		tell window 1
			click button "Continue"
			click button "Continue"
			delay 2
		end tell
		set c to count of rows of table 1 of scroll area 1 of window 1
		repeat with i from 1 to c
			if value of text field 1 of row i of table 1 of scroll area 1 of window "Network Diagnostics" is "McGrail" then
				
				select text field 1 of row i of table 1 of scroll area 1 of window "Network Diagnostics"
				exit repeat
			end if
		end repeat
		
	end tell
end tell

but it doesn’t actually select my network or any other network for that matter

if anyone can help I would appreciate it

thanks
MM

Model: MBP 2.6 core 2 Duo
Browser: Firefox 2.0.0.11
Operating System: Mac OS X (10.5)

Hi,

I can’t believe, that the problem couldn’t be solved by e.g. deleting /Library/Preferences/SystemConfiguration/com.apple.airport.preferences.plist
or creating a new network location or something like this.

This is a simpler version of your script, hope it works


activate application "Network Diagnostics"
tell application "System Events"
	tell process "Network Diagnostics"
		tell window 1
			repeat until value of static text 9 is "Select Airport network"
				click button "Continue"
			end repeat
			delay 0.5
			tell (1st row of table 1 of scroll area 1 whose value of text field 1 is "McGrail") to set value of attribute "AXSelected" to true
			click button "Continue"
		end tell
	end tell
end tell