Lynx provides simple keystroke recording/scripting with -cmd_log and -cmd_script.
The man page doesn't provide much detail on the behavior of these arguments, and what it does describe makes certain behavior somewhat baffling:
I would like to create a macro to navigate to a search input field on a specific page.
It is easy to use -cmd_log=steps to record navigating to Wikipedia (for example) and searching for an article, and then quitting. The steps are recorded as individual actions in the file steps. The steps can be edited; if you change some of the keystrokes, you can search for different text. If you comment out the last steps (quitting), you will be left on the search page, and can continue from there. If you want the search to be executed by the user rather than the script, the behavior is unexpected.
Through trial and error, I believe I've determined that navigation keys allow the user to position the cursor anywhere on the page except on input fields. If any instructions would cause the cursor to end up positioned on an input field (such as a search bar), the cursor is instead placed at the top of the page.
I've read the man page as well as further help from the official https://lynx.invisible-island.net/lynx_help/lynx_help_main.html
Nothing I can find addresses this (or provides much detail on -cmd_script at all)
I want to use the macros to position the cursor on the page, ready to input in a specific location.
I have already read Question about lynx text browser , which appears to be slightly incorrect (or at least incomplete) when it says "if you want to be positioned in the lynx," as the instructions given do not actually (consistently) position the cursor on the web page.