You'll have to show us the part of the script that errors before we can fix it. I'm guessing an array reference out of bounds or something like that.

I think what Les was getting to was that you should write error checking into your script so that KiX doesn't try to do something it shouldn't. It is basic programming 101 for any language.