Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the '10.6: Automate Internet Sharing revisited' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.6: Automate Internet Sharing revisited
Authored by: randvd on Aug 13, '11 11:49:32AM

I used this hint in 10.5. i am not updating to 10.7 and of course what I had created in 10.5 does not work. I also added the line to close the System prefs. Below is the code I used. My thanks to BrentT for his original work.

Rand

tell application "System Preferences"
activate
end tell

tell application "System Events"
tell process "System Preferences"
click menu item "Sharing" of menu "View" of menu bar 1
delay 2
tell window "Sharing"
click checkbox 1 of row 11 of table 1 of scroll area 1 of group 1
delay 1
if (exists sheet 1) then
if (exists button "Turn AirPort On" of sheet 1) then
click button "Turn AirPort On" of sheet 1
delay 1
end if
click button "Start" of sheet 1
end if
end tell
end tell
end tell
tell application "System Preferences"
activate
end tell



[ Reply to This | # ]