This forum is intended to deal with incidental problems, not structural and systemic ones like yours: lack of InDesign knowledge and lack of understanding about scripting.
I mentioned all this before, I'll do it again (one last time). Many of the questions about InDesign that you post in this forum are readily found in InDesign courses (printed and online) and reference books. That you keep coming back with often very basic things shows that you are reluctant to consult any of the recommended material. Don't be surprised therefore when fewer and fewer people will bother to answer your questions.
As for scrirpting, sure, that's not so easy to learn. It's certainly not something you can learn in this forum, you'll have to do the hard work yourself, then later you can have some problems cleared up here in this forum. Your approach earlier was to ask for scripts written for you from scratch. Recently you started posting some script that you found, change it a bit, say that it doesn't work, and request that someone fixes it.
The script you posted in this thread is a good example. Most of it is an existing script, you changed the labels a bit and ask how to get it to work for your purpose. The solution is really very simple and I provided a link to a PDF in which you can find that solution. But you don't even contemplate consulting that text.
But you can't come here, target people, and ask them to sort out your problems. Again, as I mentioned before, you need to hire a consultant who you can ask questions about InDesign and who can write custom scripts for you. Many people do that. It works well.
... View more