Last active
September 26, 2018 20:33
-
-
Save uchm4n/547921823d3df6ae3aca4489471795a1 to your computer and use it in GitHub Desktop.
Automatically fill Cisco AnyConnect credentials on mac
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
-- automatically fill Cisco AnyConnect credentials on mac | |
set targetApp to "Cisco AnyConnect Secure Mobility Client" | |
set vpnName to "yourVPNServer.com" | |
set pass to "YOURPASSWORD" | |
set loginWindowTitle to "Cisco AnyConnect | " & vpnName | |
tell application targetApp | |
activate | |
end tell | |
repeat until application targetApp is running | |
delay 1 | |
end repeat | |
tell application "System Events" | |
repeat until (window 1 of process targetApp exists) | |
delay 1 | |
end repeat | |
tell process targetApp | |
keystroke return | |
end tell | |
repeat until (window loginWindowTitle of process targetApp exists) | |
delay 1 | |
end repeat | |
tell process targetApp | |
keystroke pass | |
keystroke return | |
end tell | |
-- Waiting for "Cisco AnyConnect - Banner" window | |
repeat until (window "Cisco AnyConnect - Banner" of process targetApp exists) | |
delay 1 | |
end repeat | |
keystroke return | |
end tell | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment