Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function justAcceptThePrompt ()
- {
- username="$1"
- password="$2"
- [ -z "${password}" ] && return 1
- osascript 2>/dev/null <<EOF
- set appName to "${username}"
- set appPass to "${password}"
- tell application "System Events"
- repeat while exists (processes where name is "SecurityAgent")
- tell process "SecurityAgent"
- if exists (text field 1 of window 1) then
- set value of text field 1 of window 1 to appName
- set value of text field 2 of window 1 to appPass
- end if
- click button "Allow" of group 1 of window 1
- end tell
- delay 0.2
- end repeat
- end tell
- EOF
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement