can i send shell commands to a open window

i want to write a script that automatically fills in a form and pushes a few buttons. can i do that with bash or something similar?

Consider using iMacro.
Windows require "events" to be sent to them. bash does not do that.