2

To recieve arguments in Indesign Server you simply call:

app.scriptArgs.getValue("myvar");

But when I like to iterate over all the arguments, it seems Indesign Server doen't understand how to do this. There is a way with app.scriptArgs.getElements();, but still you can't get any arguments, see documentation.

Does anyone have a idea? I like to recieve an array list of all the arguments passed to the script.

Jeromy French
  • 11,812
  • 19
  • 76
  • 129
  • 1
    Are you using app.scriptArgs.getElements() correctly? i.e. setting its return value to an array of scriptArg? I've never done this but looking through the documentation it looks like it should work (at least in CS5). Good luck! – lhan Jun 29 '12 at 20:45

1 Answers1

2

After searching via google, I think I found solution.

var Log = new File("~/Desktop/Indd_Report.log" );
Log.open("w");

Log.writeln("app.scriptArgs.getValue(\"ArgumentArray\") = " + app.scriptArgs.getValue("ArgumentArray"));
var _ArugmentArray = app.scriptArgs.getValue("ArgumentArray").split(":");
for(var i=0; i < _ArugmentArray.length; i++ ){
    Log.writeln("_ArugmentArray[i] = " + _ArugmentArray[i]);
}

Log.close();

To Test Run ...

C:\Program Files\Adobe\Adobe InDesign CS5 Server x64>sampleclient -host localhost:18385 "C:\test.jsx" ArgumentArray="One":"Two":"Three"

Finally , Before you invoke SOAP service , you need to add below code

params.scriptArgs.push({name: "ArgumentArray", value:(Value+":"+Value));

For reference link http://forums.adobe.com/thread/853668

Frank Myat Thu
  • 4,448
  • 9
  • 67
  • 113