Even though the text input box in which I wanted iMacros to press enter was active and had the blinking text cursor, sending the event to the document body still did not work.I had to specifically send the event to the text input element, (selected by DOM ID as "TEXTBOX" below). Also note "document.focus()" added to the end of David's example to ensure that the JS is run on the current page.