I am trying to write a script that adds a new 802.1X profile. This is what I have so far:
tell application "System Preferences"
set the current pane to pane id "com.apple.preference.network"
get the name of every anchor of pane id "com.apple.preference.network"
reveal anchor "Advanced Airport" of pane id "com.apple.preference.network"
get the name of every anchor of current pane
reveal anchor "802.1X" of current pane
tell application "System Events"
click menu button 1 of tab group 1 of sheet 1 of window "Network"
Theoretically, menu button 1 should be the little plus at the bottom of the User Profiles pane, but when I run the script, it returns "System Events got an error: Can’t get window "Network"."
I just pulled the path off of UI Browser. What did I do wrong?
tell application "System Events" to tell process "System Preferences"
Retrieving data ...