Created
December 9, 2013 20:56
-
-
Save ubermajestix/7880713 to your computer and use it in GitHub Desktop.
This script allows you to open your vpn connection by launching an application. I use it to connect to a vpn from Alfred (you could use Quicksilver or LaunchBar too). In Automator, search for the "Run AppleScript" action. Double click it and copy and paste the code below. Change your vpn's name on line 3. Then export to your Applications folder …
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
tell application "System Events" | |
tell current location of network preferences | |
set VPNservice to service "yourVPN" | |
if exists VPNservice then set isConnected to connected of current configuration of VPNservice | |
if isConnected is false then | |
connect VPNservice | |
else | |
disconnect 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
Thanks!