Catch or intercept Maya event "missing reference" on file load?

I have a script that runs through a number of Maya scenes (that contain references), and if it finds a missing reference, I do not want it to stop processing. Ideally instead of bringing up the createMissingReferenceDialog I could find a way to copy a “dummy file” (like a cube) in to the path of the missing reference appears (so it can be updated later), but this is more of a “nice to have”.

I have looked at both the scriptJob and MSceneMessage as a way of handling this, but neither seem to have options for listening to this type of missing reference event, and there seems to be very little in tracing back what fires the mel “createMissingReferenceDialog” option.

Any suggestions would be appreciated.

if you’re using the file command, the -pmt flag should suppress that.

Cheers, that is great, thanks. It would still be great to catch the error (if possible), but this well certainly help.