• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

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

New Here ,
Jan 24, 2012 Jan 24, 2012

Copy link to clipboard

Copied

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

  }

}

Views

2.8K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 07, 2012 Feb 07, 2012

Copy link to clipboard

Copied

Hi,

Try this: pass the parameter to the main function:

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

main(param1);

function main(param)

{

  if(param)

  {

    ...

  }

}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 20, 2012 Mar 20, 2012

Copy link to clipboard

Copied

Hi,

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

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 20, 2013 Sep 20, 2013

Copy link to clipboard

Copied

I am having the same issue. I am pssing thru SOAP call through

     sampleclient.java -host localhost:12345 "c:\myJSXScript.jsx" myXml="myXmlLocation"

JSX:

function main() {

    try {

        var myInDesignXml;

        app.consoleout("isDefined:=" +app.scriptArgs.isDefined("myXml"));

        if (app.scriptArgs.isDefined("myXml")) {

          myInDesignXml = app.scriptArgs.getValue("myXml")

        }

        app.consoleout("myXml:=" + myXml);

        }

    } catch (e) {

        app.consoleout('General Exception');

    }

    return result;

}

main();

Output:

isDefined:=false

I should get the text that we have assigned to myXml param.

Please Help on this.

Regards,

JK

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Sep 23, 2013 Sep 23, 2013

Copy link to clipboard

Copied

LATEST

I don't see any inherent problem with the jsx.

I suggest you debug the code with ExtendScript Toolkit with your InDesign server instance selected in the dropdown of the toolkit.

This would allow you to find the source of error.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines