static void ExecuteJavaScrtiptFunction(string javaScript, string functionName, string args) { var app = new Application("Adobe InDesign CC 2014"); app.JavaScript(javaScript); Console.WriteLine(app.Execute(functionName, args)); }
static void RunJavaScrtiptFunction(string javaScript, string functionName, string jsonArgs) { var settings = new JsonSerializerSettings { ContractResolver = new CamelCasePropertyNamesContractResolver(), }; var args = JsonConvert.DeserializeObject(jsonArgs, settings); var app = new Application("Adobe InDesign CC 2014"); app.JavaScript(javaScript); var result = app.Run(functionName, args); Console.WriteLine("Result: {0}", result); }