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:
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:
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:
- Open System Preferences.
- Select the Network preference pane.
- From the Location pop-up menu, select Edit Locations.
- 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.
- In either case, give the new location a distinctive name (e.g. "Office w/proxy") and click Done.
- 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.)
- Edit the new location with whatever settings (e.g. proxy) are needed.
- Click Apply again.
- Open the Apple menu, select the Location submenu, and admire your shiny new network settings switcher.