Skip to content

Instantly share code, notes, and snippets.

@Leask
Last active December 20, 2015 00:19
Show Gist options
  • Select an option

  • Save Leask/6040717 to your computer and use it in GitHub Desktop.

Select an option

Save Leask/6040717 to your computer and use it in GitHub Desktop.
Connect VPN via AppleScript
tell application "System Events"
tell current location of network preferences
set serviceVpn to service "NAME" -- name of the VPN service
if exists serviceVpn then connect serviceVpn
end tell
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment