Command Line parameters and debug console with Mac OS MoI v4 beta Jan-22-2020

Next
 From:  goetzmoritz
9690.1 
Hi there,

so I want to use getCommandLineParams() method but somehow I'm not able to make it work. Because I was not able to access any debug console I typed:

moi.log(moi.command.getCommandLineParams());
moi.ui.alert(moi.getLog());
moi.exit(true);

But when I start the App by:

./MoI\ v4\ beta\ Jan-22-2020.app/Contents/MacOS/MoI testscript.js test

All I get is:
/Users/michael/src/moix/moi_lib/Init.cpp 310: Moi starting up
in a window with the ok-button and thats it :)

Any advice on this? thanks :)
  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
Next
 From:  Michael Gibson
9690.2 In reply to 9690.1 
Hi goetzmoritz, the moi.command.getCommandLineParams() gets the command line parameters of the currently running MoI command, not the parameters given to MoI.exe .

Commands can be run with parameters given to them, like "Open filename.3dm" for example, and moi.command.getCommandLineParams() is used by commands that can accept parameters to find out what they are.

You can instead use (in MoI v4) moi.getExecutableCommandLineArgs() to get the ones given to MoI.exe when it was launched. It returns a list of strings.

- 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
Next
 From:  goetzmoritz
9690.3 In reply to 9690.2 
Hi Michael,

thank you, that worked.

Great piece of software you've created there!

Now, what about the debug console? Is there any way to access that on macos besides that hacky way to paste it into a alert window?
  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:  Michael Gibson
9690.4 In reply to 9690.3 
Hi goetzmoritz, I'm glad that worked! You can show the debug log on Mac by setting up a shortcut key and putting this on it:

script: moi.ui.createDialog( 'ShowLog.htm' );

- 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
 

Reply to All Reply to All