In my job I frequently need to switch VPN connections and it’s very cumbersome to use the Cisco client because it refuses to allow pasting a password in the password field or even keep a list of the most recent used configurations.
Shimo is an awesome app that allows you to configure various VPN connections including passwords (stored in Keychain). So life got better.
Today I decided to up the game and check if Shimo can be automated. It can: https://feingeist.freshdesk.com/support/solutions/articles/6000161011-establishing-a-vpn-connection-using-apple-script
So I wrote an Applescript and added that to an Alfred Workflow. In the image of the applescript in Alfred, the green bars are the names of the connections in Shimo. The red bars are variable names that represent the strings, e.g. set workVPN to “My VPN connection at work”. And then ‘set acc to workVPN’ later on in the if statement block.
I chose some letters here that are easy for me to remember for each of the VPN connections, but they can be chosen any way you want.
I’ve chosen ‘c’ to close all connections, but of course simply closing Shimo would do the job as well.
You start the Alfred workflow with ‘vpn’ followed by the letter of the VPN connection.
I hope this helps someone.