Thank you everyone for the helpful replies. Some of the solutions were new to me, but the script now runs successfully. I'm still learning to ride the snake but I love this language! Ian