When I worked in Pre-Sales I found using TextPad for storing useful bits of script invaluable. I have attached the TCL file that I use which anyone can use in conjunction with TextPad which you can download from here TextPad - the text editor for Windows
Hope this helps but please don't complain if something doesn't work just keep on trying. It also has some macro script and Set Analysis as well.
Good Luck and hope it helps.