File Scripts

 From:  Michael Gibson
7119.12 In reply to 7119.11 
Hi Robert, it looks like I had a bug in that one, it needs to be name.length-3 to strip off the existing extension , I forgot the -3 part.

Try this:

script: /* SaveAs no dialog */ var name = moi.geometryDatabase.currentFileName; if ( name != '' ) { moi.geometryDatabase.saveAs( name.substr(0, name.length-3) + 'obj', 'NoUI=true' ); }


re: alert - instead of using just plain alert() instead use moi.ui.alert(), that should pop up an alert dialog for you.

alert() is not part of the base JavaScript language itself, it's part of the web browser environment that you're used to your scripts normally running in. When you execute a shortcut key script, that is happening in an isolated script context all by itself rather than running inside of the browser environment, that's the difference.

re: In addition are there any debuggers so that I can inspect variables, execution location, etc, or is this done through alert() dialogues in Moi?

Sorry no there isn't currently any debugger for inspection and breakpoints and stuff like that.

- Michael