What script? almut gave you a complete script to perform the task you asked for. If you want to do something else, have further requirements, or you have existing code you want to add this facility to you have to give us more information. We can invent all sorts of things you might be trying to achieve, but that is a waste of our time and a waste of your time. Save some time all round by posting a cogent question with sufficient context that we can give you useful answers.