This uses scripted automation, included with the new rule engine, and Jython, but you could use any supported scripting language. The documentation, examples, and helper libraries for Jython are much more advanced. Here is a beta add-on to simplify the installation…