set socksStatus to do shell script "networksetup -getsocksfirewallproxy Wi-fi | grep Enabled"
if (offset of "Yes" in socksStatus) = 0 then
do shell script "networksetup -setsocksfirewallproxystate Wi-fi On"
display notification "Proxy Enabled !"
else
do shell script "networksetup -setsocksfirewallproxystate Wi-fi Off"
display notification "Socks disabled"
end if
How to add a button to the toolbar that invokes above AppleScript? Menu Item = View, Customize Toolbar.
