tell application "System Preferences" to set current pane to pane "com.apple.preferences.sharing"
tell application "System Events" to tell process "System Preferences"
click checkbox 1 of row 11 of table 1 of scroll area 1 of group 1 of window "Sharing"
delay 1
click button "Turn Airport On" of sheet 1 of window "Sharing"
delay 1
click button "Start" of sheet 1 of window "Sharing"
if (exists sheet 1 of window "Sharing") then
click button "Start" of sheet 1 of window "Sharing"
end if
try
set message to "Internet Connection Sharing Enabled"
my growlnote("General Notification", message)
on error
set message to "Internet Connection Sharing Failed"
my growlnote("error notification", message)
end try
end tell
ignoring application responses
tell application "System Preferences" to quit
end ignoring
on register_growl()
try
tell application "GrowlHelperApp"
set the allNotificationsList to {"General Notification", "Debug Notification", "Error Notification"}
set the enabledNotificationsList to {"General Notification", "Debug Notification", "Error Notification"}
register as application "Enable Internet Connection Sharing" all notifications allNotificationsList default notifications enabledNotificationsList icon of application "Sharing"
end tell
end try
end register_growl
on growlnote(growltype, str)
try
tell application "GrowlHelperApp"
notify with name growltype title growltype description str application name "Enable Internet Connection Sharing"
end tell
end try
end growlnote
ÀÚµ¿À¸·Î ²ô´Â ºÎºÐÀÔ´Ï´Ù.
register_growl()
tell application "System Preferences" to set current pane to pane "com.apple.preferences.sharing"
tell application "System Events" to tell process "System Preferences"
click checkbox 1 of row 11 of table 1 of scroll area 1 of group 1 of window "Sharing"
delay 1 do shell script "sudo networksetup -setairportpower AirPort off"
try
set message to "Internet Connection Sharing Disabled"
my growlnote("General Notification", message)
on error
set message to "Internet Connection Sharing was Not Enabled"
my growlnote("error notification", message)
end try
end tell
ignoring application responses
tell application "System Preferences" to quit
end ignoring
on register_growl()
try
tell application "GrowlHelperApp"
set the allNotificationsList to {"General Notification", "Debug Notification", "Error Notification"}
set the enabledNotificationsList to {"General Notification", "Debug Notification", "Error Notification"}
register as application "Enable Internet Connection Sharing" all notifications allNotificationsList default notifications enabledNotificationsList icon of application "Sharing"
end tell
end try
end register_growl
on growlnote(growltype, str)
try
tell application "GrowlHelperApp"
notify with name growltype title growltype description str application name "Enable Internet Connection Sharing"
end tell
end try
end growlnote