Run script on save?

Is there a way to make a "macro" (Editor plugin, whatever) to run a script whenever the user saves the current scene? The only way I can think to do it is to make an Editor interface that provides a button which runs the script and then saves the scene, but that's not ideal.

I never used it, but i think a SaveAssetsProcessor would do what you need. Scenes are also just assets so they should go through this as well.

The documentation on this is very thin, but i guess you just create a derived processor and you will be fine ;)

This class is quite new, yoyo said it has been implemented in Unity 3.2.

Here's an example how to implement a SaveAssetsProcessor