I’ve been trying to make internet sharing a little easier by automating the setup process. I’ve done pretty good so far, but cannot get Applescript to click the “Start” button in the new sheet dialog after clicking “Start” in the main window” it keeps telling me, “System Events got an error: NSReceiverEvaluationScriptError: 4.” Here’s what I’ve got so far (the trouble spot is commented out)…
tell application "System Preferences"
activate
set current pane to pane "com.apple.preferences.sharing"
end tell
tell application "System Events"
get properties
tell process "System Preferences"
tell window "Sharing"
tell tab group 1
click radio button "Internet"
if value of static text 1 is "Internet Sharing Off" then
if value of pop up button 1 is not "Built-in Ethernet" then
click pop up button 1
click menu item "Built-in Ethernet" of menu 1 of pop up button 1
end if
tell table 1 of scroll area 1
set selected of row 3 to true
if value of checkbox 1 of row 3 is 0 then
click checkbox 1 of row 3
end if
end tell
click button "Start"
(*click button "Start" of sheet 1*)
end if
end tell
end tell
end tell
end tell
Any help would be greatly appreciated.