This script will be usefull if you want to enable VPN automatically on coming to work and to disable it on escaping from work using great Control Plane app.
It is assumed that you use Tunnelblick to manage VPN connections.
To connect to VPN:
set q to "<your_connection_name>"
tell application "Tunnelblick"
set configs to get name of configurations
if q is in configs then