AppleScript to dial VPN and run something
- September 28th, 2010
- Write comment
This is a work in progress where halfway through I realized that what I wanted to do wasn’t achievable via the Office VPN, I thought someone else might find it useful:
tell application "System Events" tell current location of network preferences set VPNservice to service "VPNNAME" -- name of the VPN service if exists VPNservice then connect VPNservice repeat until (connected of current configuration of VPNservice) delay 1 end repeat set isConnected to connected of current configuration of VPNservice if isConnected then -- Do something end if end tell end tell