MacOS Sierra - Automator/Shortcut to disable proxy?

Our company policy allows us to use the company laptop for personal matters, but of course, the proxy prevents us to visit some sites like Netflix etc. So I frequently disable the proxy - I'd like to have a shortcut or a more convenient way, than actually digging through the menu every time. I tried Automator, but it doesn't seem to recognize my click on the "Advanced..." tab in the settings, so it crashes at that step: enter image description here

Is there a way I could set Automator or a keyboard shortcut up to disable the proxy easily? Thanks!

UPDATE:

I tried networksetup -setwebproxystate Wi-Fi off, but it doesn't seem to do anything. After running the command, the proxy setting is still the same:

enter image description here


Instead of using Watch Me Do for scripting System Preferences UI interactions, add a Shell Script action with the following:

networksetup -setautoproxystate Wi-Fi off

where ‘Wi-Fi’ is the name of the network service you are modifying, shown selected in the left sidebar when viewing the Network preference pane.


Rather than scripting the switch, why not create a network location (essentially, another set of network settings) with proxy on vs. off. Once you have multiple locations set up, a Location submenu appears under the Apple menu that lets you switch.

To create a new location:

  1. Open System Preferences.
  2. Select the Network preference pane.
  3. From the Location pop-up menu, select Edit Locations.
  4. If you want to create a new location from scratch, click the Add ("+") button under the location list. If you want to start from a duplicate of your existing settings, select the current location, choose Action menu (gear icon under the location list) > Duplicate Location.
  5. In either case, give the new location a distinctive name (e.g. "Office w/proxy") and click Done.
  6. Click Apply. (Network Prefs requires you to "Apply" changes before they actually happen. I've seen glitches where it fails to properly remember changes to new locations if the new location isn't actually fully created yet.)
  7. Edit the new location with whatever settings (e.g. proxy) are needed.
  8. Click Apply again.
  9. Open the Apple menu, select the Location submenu, and admire your shiny new network settings switcher.