Skip to content

Instantly share code, notes, and snippets.

@SamRothCA
Last active March 23, 2021 03:56
Show Gist options
  • Save SamRothCA/bf0c81c000b5e9a4cd26 to your computer and use it in GitHub Desktop.
Save SamRothCA/bf0c81c000b5e9a4cd26 to your computer and use it in GitHub Desktop.
activate application "Cisco AnyConnect Secure Mobility Client"
tell application "System Events" to tell process "Cisco AnyConnect Secure Mobility Client"
click menu item "Show AnyConnect Window" of menu "Cisco AnyConnect Secure Mobility Client" of menu bar 1
click button "Connect" of window 1
set secondsLeft to 5
repeat until window "Cisco AnyConnect | vpn.mobile.unibas.ch" exists
if secondsLeft is 0 then
error "Failed to bring up AnyConnect login"
end if
set secondsLeft to secondsLeft - 1
delay 1
end repeat
keystroke "password"
click button "OK" of window 1
set secondsLeft to 5
repeat until window "Cisco AnyConnect - Banner" exists
if secondsLeft is 0 then
error "Failed to bring up AnyConnect banner"
end if
set secondsLeft to secondsLeft - 1
delay 1
end repeat
click button "Accept" of window 1
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment