title: How to pass arguments to an AutoIt script from Java code
body: <p>I wrote a Selenium script to download an Excel sheet, open, edit and upload it back. I use AutoIt for the file upload.</p>
  
  <p>I have different files to upload for each run, so I can't hard code the file path, hence I want to pass it (to the AutoIt script) as an argument. The AutoIt script:</p>
  
  <pre><code>ControlFocus("File Upload", "", "Edit1")
  Sleep(1000)
  ControlSetText("File Upload", "", "Edit1", "C:\Users\nilasing\Downloads\somefilename")
  Sleep(1000)
  ControlClick("File Upload", "", "Button1")
  </code></pre>
  
  <p><code>"C:\Users\nilasing\Downloads\somefilename"</code> is the hard coded path.</p>