Thanks! I wrote my own script for it too, if you're interested I can share it with you.
I would really appreciate that! Mine is such a mess and still broken in many places but works close to the way I want, maybe I can learn from yours.