File Scripts
All  1-11  12-13

Previous
Next
 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
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  RobertH
7119.13 
Thanks Michael! that fixed the problem, also for the alert information, that makes sense.
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All

 

 
 
Show messages: All  1-11  12-13