Last active
March 23, 2021 03:56
-
-
Save SamRothCA/bf0c81c000b5e9a4cd26 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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