How can I access the Animation Clip currently selected in the Animation Window from an editor script?

If anyone else comes to this question as I did, there’s more information in this thread. Basically, it seems like this might be an option in Unity 5.5, but before that we’re mostly out of luck.