I created the script you need some time ago. (I hope it is what you need ) Here is the link. <click>
I hope that link works an you can use my script

Manni