title: How to Click a popup Dialog Window
body: <p>I am having a problem with making a code to run DiskWarrior Automatically. The Problem is when i open the application, a SecurityAgent Dialog Pops up and asks for my username and password, and i do not know how to "click" into the Security Agent window so i can type in the username and password. I know how to code the name/password but i don't know how to "click" into the SercuirtyAgent window. I have tried using the UI inspector but thus far have had no luck. Does any one know how to code "clicking" the SecurityAgent window</p>
  
  <p>Any/all help and feedback would be appreciated.</p>
  
  <p>Here is what i have so far, still trying to figure it out:</p>
  
  <pre><code>tell application "DiskWarrior"
      open
  end tell
  delay 1
  tell application "System Events"
      tell process "SecurityAgent"
          click text field 1
          delay 3
          keystroke "a user name"
                  delay 3
                  keystroke tab
                  delay 3
                  keystroke "a password"
                  delay 3
                  keystroke return
      end tell
  end tell
  </code></pre>