Friday, May 3, 2013

Create a VPN Shortcut in OS X

10:01 PM

A virtual private network, or VPN, is a method of securely connecting to a network from a remote location, and is commonly used in work environments. While some institutions require the use of third-party VPN client software, others allow the use of Apple's built-in VPN clients.
In these cases, you can choose to enable the VPN menu in the OS X menu bar, and can then use it to quickly establish a VPN connection. However, if you are regularly connecting to your VPN, you may choose to also implement a hot-key shortcut to speed things up a bit more.

This workflow will connect a VPN service called 'MyVPN (PPTP)' when run (click for larger view).
(Credit: Screenshot by Topher Kessler/CNET)
To do this, you will need to use Apple's Automator program to link a small AppleScript routine to a hot key, which can be done by following this procedure:
  • Open the Automator utility and create a new "Service" workflow.
  • Set the workflow to receive "no input" in "any application" in the top-most menus.
  • Add the "Run AppleScript" action to the workflow, and replace its script contents with the following (adapted from MarkupBoy):
tell application "System Events"
     tell current location of network preferences
          set VPN to "SERVICE NAME"
          set VPNactive to connected of current configuration of service VPN
          if VPNactive then
               disconnect service VPN
               connect service VPN
          end if
     end tell
end tell
  • Be sure to replace SERVICE NAME with the name of your VPN connection, which can be looked up in the Network system preferences (if the name is truncated, click the Advanced... button and view the full name at the top of the Advanced Settings panel).
  • Save the workflow with a name like "Connect to VPN"
When this is finished, go to the Keyboard system preferences and select the Keyboard Shortcuts tab, where you can locate the "Connect to VPN" service in the Services section, and assign a custom keyboard shortcut to it. You should now be able to toggle your VPN connection on and off from within any application by using this shortcut.

Note: If this tutorial worked for you (and it should work), please leave a comment below. Thanks.

Written by

We are Creative Blogger Theme Wavers which provides user friendly, effective and easy to use themes. Each support has free and providing HD support screen casting.


Post a Comment


© 2013 iFlasha. All rights resevered. Designed by Templateism

Back To Top