0 Replies Latest reply on Oct 12, 2016 7:38 AM by jamesh28918422

    EvalScript error is not verbose enough  - registering for toolChanged events

    jamesh28918422 Level 1
      • What sequence of js commands should we send to listen to a phoshop toolChanged event.  We have submitted this code via the client side extension.  The call to stringIDToTypeID("toolChanged") fails, why is that?
      var event = new CSEvent("com.adobe.PhotoshopRegisterEvent", "APPLICATION");event.extensionId = adobe_iface.getExtensionID();event.appId = adobe_iface.getApplicationID();var id;

      adobe_iface.evalScript('stringIDToTypeID("toolChanged")', function(response) { id = response; }); // FAILS

      event.data = id;
      • How do we debug the javascript running in the photoshop engine; we submit certain snippets of code to the engine via:
      var adobe_iface  = new CSInterface();
      adobe_iface.evalScript(str, function (response) {//alert("received response from Adobe engine: " + response + "\n");  how can we get an error back from the engine to help us debug.  Currently we receive "EvalScript error." message but that doesn't provide us enough insight into the error.  We can debug our extension side javascript via the browser:
      • We also tried this sequence to register for the toolChanged event.  We submit this string to the Adobe js engine via evalScript and it fails to evaluate, why?

      var idNS = stringIDToTypeID( 'networkEventSubscribe' ); var desc1 = new ActionDescriptor(); desc1.putClass( stringIDToTypeID( 'eventIDAttr' ), stringIDToTypeID( "toolChanged" ) ); executeAction( idNS, desc1, DialogModes.NO ); 'subscribeSuccess';