Skip navigation
Currently Being Moderated

InDesign server CS 5.5 - app.scriptArgs.get doesn't work in jsx script or simpleclient problem

Jan 24, 2012 5:38 AM

Hello

 

I'm working with Adobe InDesing Server CS 5.5 and having problem that *.jsx script is not able to read input parameters passwd from sampleclient.exe or SOAP (same story in both cases)

I run following command:

 

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

also

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

and even

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

 

 

app.scriptArgs.get("param1") is always FALSE (see script body below).

Please help, I couldn't find an answer anywhere. All documents stats that this should work in a way I described, but it doesn't. Script is performed but param1 is not set.

 


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);

  }

}

 
Replies
  • Currently Being Moderated
    Feb 7, 2012 4:12 AM   in reply to hxkris-dev

    Hi,

     

    Try this: pass the parameter to the main function:

     

    var param1 = app.scriptArgs.get("param1");

     

    main(param1);

     

    function main(param)

    {

      if(param)

      {

        ...

      }

    }

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 20, 2012 6:58 AM   in reply to hxkris-dev

    Hi,

    First try: if(app.scriptArgs.isDefined('param1'));

     

    Second, use: app.scriptArgs.getValue('param1') to get the Value of the param

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points