Skip to content

Instantly share code, notes, and snippets.

@y-fedorov
Created October 13, 2016 11:56
Show Gist options
  • Save y-fedorov/a8ff2aed2bb80d0d48b7583cd475a4ca to your computer and use it in GitHub Desktop.
Save y-fedorov/a8ff2aed2bb80d0d48b7583cd475a4ca to your computer and use it in GitHub Desktop.
--
-- for command line osascript ./vpn_run.scpt and add permission to "security & privacy"
--
activate application "Cisco AnyConnect Secure Mobility Client"
tell application "System Events"
repeat until window 1 of process "Cisco AnyConnect Secure Mobility Client" exists
end repeat
tell process "Cisco AnyConnect Secure Mobility Client"
tell window 1
tell combo box 1
set focused to 1
set value to "vpn-access.mycompany.com"
end tell
click button "Connect"
end tell
repeat until window "Cisco AnyConnect | vpn-access.mycompany.com" exists
end repeat
tell window "Cisco AnyConnect | vpn-access.mycompany.com"
tell text field 1
set value to "<user>"
end tell
tell text field 2
set value to "<password>"
end tell
click button "OK"
end tell
end tell
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment