Created
January 30, 2011 08:34
-
-
Save palaniraja/802695 to your computer and use it in GitHub Desktop.
Apple script to toggle internet sharing (via airport)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on run {input, parameters} | |
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 0 | |
tell window "Sharing" | |
click checkbox 1 of row 11 of table 1 of scroll area 1 of group 1 | |
delay 0 | |
if (exists sheet 1) then | |
if (exists button "Turn AirPort On" of sheet 1) then | |
click button "Turn AirPort On" of sheet 1 | |
delay 0 | |
end if | |
click button "Start" of sheet 1 | |
end if | |
end tell | |
end tell | |
tell application "System Preferences" to quit | |
end tell | |
return input | |
end run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment