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.
- For Mac users you'll need to install Homebrew.
- After you have installed this tool you can quickly and easily download and install other handy command-line applications in this case Cliclick.
- Open up Terminal, type the following
brew install cliclick
- You should be able to run the command
cliclick -hand you'll be given a list of all the commands you can use with this application.
- Now while still in terminal navigate to an appropriate directory in my case the desktop will do. Run the command
- Run the command
chmod u+x myNewClickAppto make that file you just created an executable.
- Open up and text editor in my case Sublime Text and open the file you just created and write the following in that document:
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'
- IMPORTANT NOTE: Before running this script open up a blank 'Sublime Text' text document and maximize it's window. What this script will do when you run it is first click on the center of your page i.e. my screen resolution is 1280 X 640 / 2 = 640 X 320
- Now in terminal you can run the command
./myNewCliclickAppand it will run the script you just wrote.
- It should work something like this