Use the Spy function and click the desired box. Note that data from the page populates in the Spy box.
Copy the text from the descriptor box at the bottom. Use this to correct the script:
WriteHTML("INPUT TEXT[ID= 'q']", "hello")
becomes
WriteHTML("INPUT TEXT[NAME= 'q']", "hello")
Then save and run the script.