Skip to content

Instantly share code, notes, and snippets.

@SuperHofstad
SuperHofstad / Tell SecurityAgent to input password and press Enter when process SecurityAgent exists
Last active January 16, 2019 01:27
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