Your comments

I've written something that does this, its a bit hackish but works great. I'll post back when its ready.