title: Making AppleScript fill form
body: <p>the problem I'm having is making me sick. I'm working over an applescript that throws action to fill form. I think I'm having an issue while getting it to wait until the site is loaded in 100%. The script activates the site but doesn't fill the forms. Please navigate me and help to work out this lazy script:</p>
  
  <pre><code>tell application "Safari"
  set loginurl to "http://www.dogomania.pl/forum/register.php"
  set mylogin to "worker100"
  set mypassword to "blackie698"
  tell application "Safari"
      make new document at end of documents
      set URL of document 1 to loginurl
      delay 4
      do JavaScript "document.forms['regusername']['username'].value = '" &amp; mylogin &amp; "'" in document 1
      do JavaScript "document.forms['password']['password'].value = '" &amp; mypassword &amp; "'" in document 1
  end tell
  </code></pre>
  
  <p>end tell</p>