Take a screenshot of the top-most window
I just hacked together this little tool. 

https://github.com/vorgos/QuickGrab

It is a command line tool that will capture the top most active window or any window you specify just like the -l option in the newer version of screencapture.

Hope that helped.