/ Published in: AppleScript
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
on toggle_vpn() tell application "System Events" repeat with s in services of network preferences if kind of s is 14 then -- 14 is VPN if not connected of configuration of s as boolean then tell s to connect else tell s to disconnect end if end if end repeat end tell end toggle_vpn