0

I tried many methods to toggle internet sharing with Alfred but its not working! Its driving me crazy!

Can anyone please help me with an AppleScript which I can paste in Alfred and assign a hot key to perform this function?

ps: I don't have much knowledge with scripts. Ill just copy paste the script from here if I get an answer from someone!

1 Answer 1

1

You could try this (tested on OSX 10.9.5 but it may depends on the version of you OS) :

tell application "System Preferences"
-- display system preferences window
activate
-- wait to see the window
delay 1.5
-- try again
activate
-- Open sharing tab (or pane)
set current pane to pane "com.apple.preferences.sharing"
-- we want to see it
delay 1.5

tell application "System Events"
    tell process "System Preferences"

        -- click the checkbox to enable internet sharing
        tell window 1 to click checkbox 1 of row 8 of table 1 of scroll area 1 of group 1
    end tell
end tell
-- wait to see the result
delay 1.5
--quit -- we can quit system preferences
end tell
2
  • Not working! Mine is Sierra 10.12.1! Commented Oct 29, 2016 at 9:27
  • Does the system preferences window appear ? Commented Nov 3, 2016 at 12:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .