Quantcast
Channel: Daz Script Developer Discussion - Daz 3D Forums
Viewing all articles
Browse latest Browse all 1036

How to use DzProcess on a Mac?

$
0
0

I have created a small program that I am calling from Daz Script.  The windows version works perfectly.  I cannot get the Mac version to work. 

First, where does Daz want these small programs to be located on a Mac (this is for a product to be sold)?  On Windows, I can just put them in Data/RiverSoft Art/Common and it works fine as Windows isn't particular about where an exe runs from.  On Mac, I have tried both just /Applications and /Applications/DAZ 3D/DAZStudio4 64-bit/bin.  I can run my program directly from the shell in those two locations, e.g.,

$ /Applications/MyProgram.app/Contents/MacOS/MyProgram

This works.  However, I cannot get the DzProcess code to work.  The Process.start always returns false.  Is it supposed to work on the Mac?  Any help is appreciated.  Here is my DzProcess code:

var sMacOSXTattooApp = '/Applications/MyProgram.app/Contents/MacOS/MyProgram';

[...]

  if (App.platform() == App.Windows)
  {
     var file = helper.replaceAll(sWinTattooApp, '/', '\\');
    var aProcessArgs = [
      '"'+file+'"',
      "getFont",
      tempfile,
      'DONOW'
//      '"'+helper.replaceAll(tempfile, '/', '\\')+'"',
    ];
  }
  else if (App.platform() == App.MacOSX)
  {
    var file = sMacOSXTattooApp;
    var aProcessArgs = [
      '"'+file+'"',
      "getFont",
      tempfile,
      'DONOW'
    ];
  }
  else
    return [];
  oProcess = new DzProcess();

  // Assign the arguments
  oProcess.arguments = aProcessArgs;
  oProcess.communication = DzProcess.Stdin | DzProcess.Stdout;
  // If starting the process fails
  if( !oProcess.start() ){
    // Inform the user
    MessageBox.critical( qsTr("Could not start Word Tattoo.  Please check your installation"), qsTr("Fatal Error"), qsTr("&OK") );
    return [];
  }

 


Viewing all articles
Browse latest Browse all 1036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>