Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Adriem/8c52310c30dd654778c65f476ff7d4ff to your computer and use it in GitHub Desktop.
Save Adriem/8c52310c30dd654778c65f476ff7d4ff 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