Maxscript startup utility does'nt work unless I run the script again manually

Descriptive title^^

I’ve got this big ol’ script which I’ve decided should be a utility. I’ve added the GUI, made sure it all plugs together properly and plonked the ms file into scripts/startup.

There can’t be anything very wrong with the code because it all works provided I manually run the script after startup.

I assume I’m declaring things in the wrong places or something

The first thing it fails on is appending stuff to an array - I can’t tell if anything goes wrong after that

The array is declared as empty (ie. materialList = #() ) in the open event handler for the utlity. I get no errors trying to append to it but it reports as empty (ie. #()) when I print it after doing my appends.

Is there a special formula for making a utility start up fully initialised? eg. declaring everything inside the utility block or sacrificing a chicken ?

cheers :slight_smile:

aha!
it seems the beginning of the answer is in here

http://tech-artists.org/forum/showthread.php?t=2124&highlight=startup