Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tell application "System Events"
- tell current location of network preferences
- if exists service "Displayed Name" then
- set VPNservice to service "Displayed Name"
- if connected of first configuration of VPNservice then
- disconnect VPNservice
- else
- connect VPNservice
- end if
- else
- display alert "Could not find VPN connection"
- end if
- end tell
- end tell
- open "/Applications/Utilities/Toggle VPN.app"
- osascript "/path/to/Toggle VPN.scpt"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement