on run argv repeat with arg in argv tell application "System Events" tell current location of network preferences set VPN to service arg set vpnConnected to connected of current configuration of VPN if not vpnConnected then connect VPN end if end tell end tell end repeat end run