Detect SaveAs location?

Is there any way for a RhinoCommon plugin to determine the target path when a SaveAs command is issued by the user? RhinoDoc.BeginSaveDocument and RhinoDoc.EndSaveDocument provide access to the document that is active when the command is issued, but since they fire before the save occurs, this document has the old path, not the new one.

I’m not sure if this is going to work, but what about subscribing to Rhino.Commands.Command.EndCommand and listen for the SaveAs command to have ended?

Maybe this event will fire at the time when the file name is the correct one.

That works! I had no idea about the existence of that event. (I do have to go through RhinoDoc.ActiveDoc, which is unfortunate.)

I’ve also just noticed DocumentSaveEventArgs.FileName, which I somehow missed.