Adding to the code

Hello Stefano,
I've changed some parts of your code:
-I've added the ordering of NSObjects to generate the tcl script always in order, no matter what the order in which the user drags the components, the script will respect the order need by ns.
-I've changed the behaviour of color entity, fixing his attributes in order to give to each color only one identifier, for example "magenta" cannot appear in Color0 and in Color10, the program will replace Color10 with the coloro unused.

I hope you will like my changes.
Luca.
 
Always wrap `if` and `else` body in curly braces, even if it's only one line. Opening `{` must stay on the same line of `if`:

    if (foo && bar) {
        baz();
    }