I have an Applescript that will connect my VPN profile when my computer boots. However, if my computer sleeps, the VPN connection is broken and the script doesn't reconnect it. Also, if there is a server disconnect, the script doesn't reconnect it either.
Here's my script:
tell application "System Events" tell current location of network preferences set myVPN to the service "MyVPN" if myVPN is not null then if current configuration of myVPN is not connected then connect myVPN end if end if end tell return 60 end tell end idle
I'm not familiar enough with Applescript to know if this is possible, but with some other scripting/programming languages, you can listen for events and respond to them.
Does Applescript have the ability to respond to system events and is there a system event that fires when a VPN profile disconnects?