View Full Version : apple script connect to random vpn if disc

Mar 6, 2013, 12:55 AM
i need help with a script that'll connect to a list of vpn if it's disconnected. the problem is it's connect to another vpn after 2mins.

on idle
tell application "System Events"
tell current location of network preferences
set myVPNList to {"NE", "Sing", "UK", "LA", "NY", "Sea", "Mia"}
set theVPNItem to some item of myVPNList
set myConnection to the service theVPNItem
if myConnection is not null then
connect myConnection
end if
end tell
return 120
end tell
end idle