Run script on open/save

Does anyone know of a way to trigger a Dynamo script on certain events? It would be awesome to run a script or batch of scripts when opening or saving a drawing.

Something similar has been done in the past for Revit (mainly in regards to batch processing files), however this doesn’t seem to have been updated for Dynamo 2.x or Dynamo for Civil3D, for that matter. Here is an example from AutoCAD 2016 on how to subscribe to document close events, however at this point you may as well code it entirely in C#.

An approach I have taken myself (for Revit, at least) is to open a “dummy” document, specify a folder with the documents I wish to modify, and then process them in the same manner by opening them in the background and closing/saving them.

Thanks for the links. I need to spend some time reading up on DynamoAutomation and see what I can learn. I’ll post back if I come up with anything.