Macro-Recorder is a simple and easy to use application that allows you to write macros directly from the command line.
For help on how to use it, see the file Syntax.md
Cookie Clicker:
> macro.exe list windows
Windows : Name
...
0000012 : Google Chrome
> macro.exe macro -w="12" m1d w10 m1u w20