Advertisement
Guest User

Untitled

a guest
May 27th, 2015
280
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. function justAcceptThePrompt ()
  2. {
  3. username="$1"
  4. password="$2"
  5.  
  6. [ -z "${password}" ] && return 1
  7.  
  8. osascript 2>/dev/null <<EOF
  9. set appName to "${username}"
  10. set appPass to "${password}"
  11.  
  12. tell application "System Events"
  13. repeat while exists (processes where name is "SecurityAgent")
  14. tell process "SecurityAgent"
  15. if exists (text field 1 of window 1) then
  16. set value of text field 1 of window 1 to appName
  17. set value of text field 2 of window 1 to appPass
  18. end if
  19. click button "Allow" of group 1 of window 1
  20. end tell
  21. delay 0.2
  22. end repeat
  23. end tell
  24. EOF
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement