Using script to generate tags and folders in the tag browser

I would like to auto generate folders and tags in the default tag database using script. Any examples would help. My project is going out to several plants and I am doing code to auto generate all the items they need to make the project work.

There are some examples here:

Thanks, I found this also.

Becareful, the way that tags are configured has changed significantly from 7.9 to 8.1

Of course, what fun is it to keep it the same. I have it working and work with both versions on my system anyway.