File Scripts

 From:  RobertH
7119.11 
Hi Michael,

Nothing appears to happen when running the script so I created a Javascript file version in order to debug it. Specifically I wanted to check the path of the file being generated. This keeps giving me the error "ReferenceError: Can't find the variable: alert". I've used this hundreds of times so I'm not sure what is causing the problem. Could you look at it and tell me what's wrong? In addition are there any debuggers so that I can inspect variables, execution location, etc, or is this done through alert() dialogues in Moi?


function DoTestBed() {

var name = moi.geometryDatabase.currentFileName;

alert(moi.geometryDatabase.currentFileName);
alert(name.substr(0, name.length) + 'obj');

if ( name != '' ) {
moi.geometryDatabase.saveAs( name.substr(0, name.length) + 'obj', 'NoUI=true' );
}

}

DoTestBed();