Detecting files, Safari, and then text field insertion

K newbie scripter looking to see if this is possible. I want to get a page everytime a file is processed while I’m out of the office.

What I want to do is this:

  1. Compressor encodes a file ( and places it in a folder (encoded movies).
  2. Safari launches the site
  3. Script inputs the pager number (1234) into the first textbox.
  4. Script inputs the filename of the completed file in the third textbox (Encoding of is complete.)
  5. Script then submits the page, and closes Safari.

Edit: I’ve got the script to open, input the text fields correctly, and send the page and then closes safari. I’m having problems with the script noticing when a new file is added to the folder.