Created
December 20, 2013 14:26
-
-
Save jayjanssen/8055465 to your computer and use it in GitHub Desktop.
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 "My VPN" -- name of the VPN service | |
if exists VPNservice then connect VPNservice | |
repeat until (connected of current configuration of VPNservice) | |
delay 1 | |
end repeat | |
end tell | |
end tell | |
-- throws this error on 10.9.1 (worked on 10.9.0) | |
-- error "System Events got an error: Can’t get network preferences." number -1728 from network preferences |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment