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

Click here to return to the '10.8: Automate Internet Sharing revisited' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.8: Automate Internet Sharing revisited
Authored by: paradoll on Aug 27, '12 07:24:19AM
Awesome, thanks! Tried this out in Mountain Lion, 10.8, checkboxes have moved around a bit: so it's now row 9 instead of 11 if anyone needs it:
tell application "System Preferences"
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 9 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

[ Reply to This | # ]