Last active
January 16, 2019 01:27
-
-
Save SuperHofstad/f826985ec536ff2d650699cb37a7fadc to your computer and use it in GitHub Desktop.
Enters text(in this case, password) in the default selected input field, and presses default selected button in the security prompt.
This file contains 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
set appPass to "PASSWORD" as text | |
tell application "System Events" | |
delay 0.5 | |
repeat until exists process "SecurityAgent" | |
delay 0.5 | |
end repeat | |
tell process "SecurityAgent" | |
# writes variable in default selected inputfield(in my case its the password field) | |
keystroke appPass | |
# sends "Enter" command to default selected button(in my case "Allow") | |
key code 36 | |
end tell | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment