Since there’s no way to do it via Terminal in 10.5, I’ve got another script written to just add the network, but it creates a user level account, and I need it to be system level. I’m almost there, but keep running into 802.1X authentication errors when I try it, and I think the problem is that TTLS and PEAP are both checked. We authenticate via PEAP, so I’m trying to automate a way to uncheck TTLS in my script.
I’ve been using the click function to uncheck the box, and when I watch the script execute, the box unchecks for a split second, then checks again, the script finishes, and I’m riddled with authentication errors. Here’s the line I’m using to uncheck:
If it matters, I’m not actually running this as a saved Applescript, but rather, through the “osascript -e” function in Bash, since I’m deploying via ARD and have other steps that I need to run first as root user.
Any help would be greatly appreciated! Thank you in advance.
Noah
tell application "System Preferences"
activate
end tell
tell application "System Events"
tell application process "System Preferences"
delay 0.5
keystroke "Airport"
delay 2
keystroke return
delay 1
click button "Advanced." of window "Network"
delay 1
click radio button "802.1X" of tab group 1 of sheet 1 of window "Network"
delay 1
click UI element 1 of group 1 of row 1 of outline 1 of scroll area 1 of tab group 1 of sheet 1 of window "Network" of application process "System Preferences" of application "System Events"
delay 0.5
keystroke tab
delay 0.5
keystroke tab
delay 0.5
keystroke tab
delay 0.5
keystroke tab
delay 0.5
keystroke tab
delay 0.5
click button "Delete Profile" of tab group 1 of sheet 1 of window "Network" of application process "System Preferences" of application "System Events"
delay 0.5
click button "Delete Profile" of tab group 1 of sheet 1 of window "Network" of application process "System Preferences" of application "System Events"
delay 1
click menu button "Add Profile" of tab group 1 of sheet 1 of window "Network" of application process "System Preferences" of application "System Events"
delay 0.5
click menu item "Add System Profile" of menu "Add Profile" of menu button "Add Profile" of tab group 1 of sheet 1 of window "Network" of application process "System Preferences" of application "System Events"
keystroke tab
delay 0.5
keystroke tab
delay 0.5
keystroke "USERNAME"
delay 0.5
keystroke tab
delay 0.5
keystroke "PASSWORD"
delay 0.5
keystroke tab
delay 0.5
click button 1 of combo box 1 of group 1 of group 1 of tab group 1 of sheet 1 of window "Network"
delay 0.5
keystroke "NETWORKNAME"
delay 0.5
keystroke return
delay 1
keystroke tab
delay 0.5
click checkbox 1 of row 1 of table 1 of scroll area 1 of group 1 of tab group 1 of sheet 1 of window "Network" of application process "System Preferences" of application "System Events"
delay 1
click button "OK" of sheet 1 of window "Network"
delay 0.5
click button "Apply" of window "Network"
delay 1
do shell script "networksetup -setairportpower off"
delay 5
do shell script "networksetup -setairportpower on"
delay 3
end tell
end tell