I work on a lot of interactive art installation production events using custom software and hardware setups temporary and permanent. It's essential to be able to automate certain processes in case the installation needs to be up and running 24/7 or you don't have some kind of remote access to your computer setup, or better yet be able to physically be on site to set things up properly.
Using a handy command-line application called Cliclick you can automate keypresses and clicks. This is a useful tool for permanent interactive installations. For example, you could use it to click off dialog boxes on startup, or click on specific windows that need to be brought to the front most application, etc. Here is a quick demo to get started.
brew install cliclickcliclick -h and you'll be given a list of all the commands you can use with this application.touch myNewCliclickAppchmod u+x myNewClickApp to make that file you just created an executable.
echo "Cliclick is clicking and writing on your page!"
cliclick c:640,320;
cliclick t:"Hello I'm your computer writing by myself in your text editor"
cliclick kp:enter
cliclick t:"Nothing weird about this at all"
and now 'Save'
./myNewCliclickApp and it will run the script you just wrote.