It's a bit difficult to make suggestions on a script that nobody has seen -- remember that we don't have access to your network or your script, and we can't see your screen.
That said, however, this does not mean that you can post a hundreds-of-lines-long script and ask someone to add some feature for you. That would be outside this forum's scope, as discussed in
the initial post in this forum.
In general, we recommend posting a short sample script that contains only the minimum amount of code needed to reproduce the problem, and be specific about what's not working (error messages, etc). Then perhaps we might be able to provide suggestions.
-- Bill Stewart [Bill_Stewart]