recordable macros

It would be great if there was a facility to “record” tasks and then be able to batch process them. This would allow a string of events to be carried out, recorded and then implemented multiple times with appropriate variables to substitute certain aspects.