On Mac OS X <= 10.10, I can run the following command to open the VPN connection window:
function go-vpn { /usr/bin/env osascript <<-EOF tell application "System Events" tell current location of network preferences set VPN to service "LF VPN" if exists VPN then connect VPN repeat while (current configuration of VPN is not connected) delay 1 end repeat end tell end tell EOF }
This will open a connection window (the same as selecting the "LF VPN" network from the VPN drop-down list). However, in El Capitan, I get the following error:
execution error: System Events got an error: Can't get current configuration of service id "18E8C59B-C186-4669-9F8F-FA67D7AA6E53" of network preferences. (-1728)
How can the equivalent of this be done in El Capitan and how can it be debugged?

applescript osx-elcapitan macos
alberto56
source share