InDesign server CS 5.5 app.scriptArgs.get doesn't work in jsx script

1k Views Asked by At

I'm working with Adobe InDesign Server CS 5.5 and having problem that *.jsx script is not able to read input parameters

I run following command: sampleclient.exe -host localhost:8080 "c:\CreateJPEG.jsx" param1="1"

Here is the script:

 #target  InDesignServer
 app.scriptPreferences.version = 7.0; 

 main();
 function main()
 {
  var eRet;    

  if (app.scriptArgs.get("param1"))
  {
    var sXMLFilePath = "C:\\CreateJPEG.xml";
    var eRet = app.createJpeg (sXMLFilePath);
  }
 }

app.scriptArgs.get("param1") is false always. All documents state that this should work.

1

There are 1 best solutions below

0
On

Check out the API documentation. app.scriptArgs.get("param1") does not return a boolean. It returns a string.

The isDefined method is what you need here.