Skip to content

Instantly share code, notes, and snippets.

@jacobsalmela
Last active August 20, 2022 13:57
Show Gist options
  • Save jacobsalmela/025d115774a00ad4d1fe to your computer and use it in GitHub Desktop.
Save jacobsalmela/025d115774a00ad4d1fe to your computer and use it in GitHub Desktop.
(OS X) Enter the password repeatedly for multiple authentication windows
#!/bin/bash
# Change 60 to however many passwords you have to authenticate for
for s in {1..60}
do
sleep 1
# Enter your password below
osascript -e <<EOF 'tell application "System Events"
tell process "SecurityAgent"
set value of text field 1 of window 1 to "password"
end tell
tell application "system events" to keystroke return
end tell'
EOF
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment