Skip to content

Instantly share code, notes, and snippets.

View crozzee's full-sized avatar

David Croswell crozzee

View GitHub Profile
@twksos
twksos / CiscoVPNConnection.scpt
Last active July 31, 2023 20:50
Cisco VPN connection auto connect AppleScript
-- Please set your vpn connection name and password here
set VPNName to "VPN name"
set VPNpassword to "VPN password"
tell application "System Events"
tell current location of network preferences
set VPNService to service VPNName
end tell
set isConnected to connected of current configuration of VPNService
tell application "System Events"
-- start playing with the VPN
tell current location of network preferences
-- set the name of the VPN service from your Network Settings
set VPNService to service "VPN myHome"
-- determine current VPN connection status
set isConnected to connected of current configuration of VPNService
if isConnected then
-- disconnect VPNService
else -- otherwise, connect to the VPN
@adgedenkers
adgedenkers / vpn_connection.scpt
Created October 11, 2012 18:16
Toggle Connection to VPN on a Mac via AppleScript
tell application "System Events"
-- get current clipboard contents as a string
set CurrentClipboard to the clipboard as string
-- set the clipboad to your password
set the clipboard to "Y0urVPNPa$$w0rd"
-- start playing with the VPN
tell current location of network preferences