Quick question about what's possible to script

Probably, you can do a lot of this with the “hidden formula device”