Created
November 5, 2012 15:16
-
-
Save prenagha/4017693 to your computer and use it in GitHub Desktop.
VPN toggle applescript for launchbar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- | |
-- applescript to toggle connection state of vpn | |
-- http://markupboy.com/blog/view/toggling-vpn-with-applescript | |
-- http://www.plankdesign.com/blog/2012/06/toggle-your-network-settings-with-launchbar/ | |
-- | |
tell application "System Events" | |
tell current location of network preferences | |
-- set this to the name of your VPN config | |
set VPNservice to service "vpn service name" | |
set isConnected to connected of current configuration of VPNservice | |
if isConnected then | |
disconnect VPNservice | |
else | |
connect VPNservice | |
end if | |
end tell | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment