Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SuperHofstad/f826985ec536ff2d650699cb37a7fadc to your computer and use it in GitHub Desktop.
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.
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