1 Reply Latest reply on Sep 17, 2009 6:34 AM by gmitchel

    CSXS evalscript Not Working

    gmitchel

      I want to use the CSXS library to call the Javascript DOM for Photoshop. It passes just a single string parameter that bundles up several parameters by separating them with commas.

       

      This is the Action Script call:

       

      CSXSInterface.instance.evalScript("applyUnsharpMaskFilter", params);

      This is the Javascrpt call:

       

      function applyUnsharpMaskFilter(params){

      var paramsTokens = params.split(",");
      amount = parseInt(paramsTokens[0]);
      radius = parseFloat(paramsTokens[1]);
      threshold = parseInt(paramsTokens[2]);
      blend = parseInt(paramsTokens[3]);
      opacity = parseInt(paramsTokens[4]);
      sharpenBlendIf1 = parseInt(paramsTokens[5]);
      sharpenBlendIf2 = parseInt(paramsTokens[6]);
      sharpenBlendIf3 = parseInt(paramsTokens[7]);
      sharpenBlendIf4 = parseInt(paramsTokens[8]);
      underlyingBlendIf1 = parseInt(paramsTokens[9]);
      underlyingBlendIf2 = parseInt(paramsTokens[10]);
      underlyingBlendIf3 = parseInt(paramsTokens[11]);
      underlyingBlendIf4 = parseInt(paramsTokens[12]);

      if (app.activeDocument.activeLayer.name == "TLR Pro USM") updateUSMLayer(amount, radius, threshold);
      else addUSMLayer(amount, radius, threshold);

      setBlendMode(blend);
      setOpacity(opacity)
      setBlendIfs(sharpenBlendIf1, sharpenBlendIf2, sharpenBlendIf3, sharpenBlendIf4,
           underlyingBlendIf1, underlyingBlendIf2, underlyingBlendIf3, underlyingBlendIf4);
      }

      The AIR logger indicates an error in com.adobe.csxs.external.CommunicationUtils

       

      Here is the logger result:

       

      15/2009 21:24:27.921 [DEBUG] com.adobe.csxs.external.CommunicationUtils [DispatchingRequest functionName="applyUnsharpMaskFilter" params="300,0.8,0,1,65,30,50,100,195,25,50,80,200"]
      ------------------
      9/15/2009 21:24:27.925 [ERROR] com.adobe.csxs.external.CommunicationUtils [Error in request data, it is null where some data is expected ]
      ------------------
      9/15/2009 21:24:27.925 [INFO] com.adobe.csxs.external.CommunicationUtils [RequestResult after parsing result="[RequestResult status="RequestResultInvalid" data=null]" ]
      ------------------
      9/15/2009 21:24:27.925 [DEBUG] com.adobe.csxs.external.CommunicationUtils [Result="[RequestResult status="RequestResultInvalid" data=null]"]

       

      The params string is being read. That's the value that should be passed. Why the error in CommunicationUtils? Any idea?

       

      Mitch