38 Replies Latest reply on Sep 28, 2018 4:28 PM by Kukurykus

    Script Events Listener

    r-bin Level 5

      In continuation of the post Re: Clean SL and at the request of the Kukurykus

      I bring to your attention the script event_listener.jsx.

       

      It allows you to write events as functions in the file ~/Desktop/EventListener.log.

       

      The script needs to be copied to the ..\Presets\Scripts folder.

      To activate it, you need to start it manually (It will be located in the menu beside "Script Events Manager").

       

      To activate, click "Enable", to deactivate, click "Disable".

       

      If you previously installed the notifiers in the Script Events Manager, it is desirable to clear them manually.

       

      While this is the first version, but I think that the latter, too.

      I do not see any prospects for further development.

       

      Maybe someone will suggest ideas or he will start developing the script himself.

       

      The script:

      <javascriptresource>
      <name>Script Events Listener...</name>
      <category>scriptevents</category>
      </javascriptresource>
      
      var log_name = "~/Desktop/EventListener.log";
      
      var dsc_name = "d";
      var lst_name = "list";
      var ref_name = "r";
      
      var dsc_numb = 0;
      var lst_numb = -1;
      var ref_numb = -1;
      
      var tab = "    ";
      
      var silent = false;
      
      var events_CS6 = [ "All " ];
      
      var events_CC = [
      "TdT ","Avrg","ASty","Asrt","AccE","Add ","AdNs","AddT","Algn","AngS","AppI","BsRl","Btch","BtcF","Blr ","BlrM","Brdr","BrgC","CnvS","ChlC","ChnM",
      "Chrc","Chrm","Cler","Cls ","Clds","ClrB","ClrH","ClrR","ClrP","CntC","Cntc","CnvM","copy","CpFX","CpyM","CpTL","Crql","CrtD","Crop","Crsh","Crst",
      "Crvs","Cstm","cut ","CtTL","Ct  ","DrkS","Dntr","DfnP","Dfrg","Dlt ","Dstt","Dslc","Dspc","DfrC","Dfs ","DfsG","dlfx","Dspl","Dstr","Draw","DryB",
      "Dplc","DstS","Embs","Eqlz","Exch","Expn","Expr","Extr","Fct ","Fade","Fthr","Fbrs","Fl  ","FlmG","Fltr","FndE","FltI","Flip","Frgm","Frsc","GsnB",
      "getd","Gls ","GlwE","Grdn","GrMp","Grn ","GraP","GrpL","Grow","HlfS","Hd  ","HghP","HsbP","HStr","ImgS","Impr","InkO","Intr","IntW","Invs","Invr",
      "LnsF","Lvls","LghE","Lnk ","Mk  ","Mxm ","Mdn ","Mrg2","MrgL","MSpt","MrgV","Mztn","Mnm ","Msc ","MscT","MtnB","move","NTSC","NGlw","Nxt ","NtPr",
      "Ntfy","null","OcnR","Ofst","Opn ","Pnt ","PntD","PltK","past","PaFX","PstI","PstO","Ptch","Phtc","Pnch","Plc ","Plst","PlsW","Ply ","Pntl","Plr ",
      "PstE","Pstr","Prvs","Prnt","PrfT","Prge","quit","RdlB","Rstr","RstT","RmvB","RmvL","RmvW","Rnm ","RplC","Rset","Rtcl","Rvrt","Rple","Rtte","RghP",
      "save","slct","SlcC","setd","ShrE","Shrp","ShrM","Shr ","Shw ","Smlr","SmrB","Smth","SmdS","Slrz","Spt ","Sphr","SplC","Spng","SprS","StnG","Stmp",
      "Stop","Strk","Sbtr","SbtF","Smie","TkMr","TkSn","TxtF","Txtz","Thrs","Tls ","TrnE","TrcC","Trnf","Trap","Twrl","Undr","undo","Ungr","Unlk","UnsM",
      "Vrtn","Wait","WtrP","Wtrc","Wave","Wnd ","ZgZg",
      "BacL","FilE","ColE","OpnU",
      
      "rigidTransform",
      "perspectiveWarpTransform",
      "Adobe Camera Raw Filter",
      "smartBrushWorkspace",
      "focusMask",
      ];
      
      
      if (!arguments.length) 
          {
          var events = (parseInt(app.version)==13)?events_CS6:events_CC;
      
          var d = new Window("dialog", "Event Listener 0.01")
      
          d.orientation = "row";
          d.spacing = 20;
          d.margins = 20;
      
          var b1 = d.add("button", undefined, "Enable");
          var b2 = d.add("button", undefined, "Disable");
      
          b1.onClick = function()
              {
              d.close();
      
              for (var i = 0; i < events.length; i++) enable_notifier(events[i], $.fileName);
      
              alert("Event Listener Enabled!", " ")
              }
      
          b2.onClick = function()
              {
              d.close();
      
              for (var i = 0; i < events.length; i++) disable_notifier(events[i], $.fileName);
      
              alert("Event Listener Disabled!", " ")
              }
      
          d.show();
          }
      
      if (arguments.length >= 2) main(arguments[0], arguments[1]);
      
      //////////////////////////////////////////////////////////////////////////
      function main()
          {
          try 
              { 
              var func_name = typeIDToStringID(arguments[1]);
              if (!func_name) func_name = typeIDToChar(arguments[1]);
      
              if (func_name.toLowerCase().indexOf("modalstate")    >= 0) return;
              if (func_name.toLowerCase().indexOf("invokecommand") >= 0) return;
              if (func_name.toLowerCase().indexOf("togglebrushesflyout") >= 0) return;
      
              var msg = null;
      
              if (!silent)           
                  {
                  msg = new Window("palette", "Event Listener", undefined, {independent:true} );
                  msg.preferredSize.width = 150;  
                  msg.txt = msg.add("statictext", undefined, func_name);
                  msg.show();
                  }
      
              var file = new File(log_name);
      
              file.open("a");
      
              file.writeln("///////////////////////////////////////////////////////////////////////////////");  
              file.writeln("function " + func_name + "_" + Math.random().toString().substr(2) + " ()");  
              file.writeln(tab + "{");  
              file.writeln(tab + "try {"); 
              file.writeln(parse_desc(arguments[0]));
              file.writeln(tab + tab + "executeAction(" + k2s(arguments[1]) + ", d, DialogModes.NO);");  
              file.writeln(tab + tab + "}");
              file.writeln(tab + "catch (e) { throw(e); }");
              file.writeln(tab + "}");
              file.writeln("");
      
              file.close();
      
              if (msg)
                  {
                  msg.close();
                  msg = null;
                  }
              }
          catch (e) { _alert(e); }
          }
      
      //////////////////////////////////////////////////////////////////////////
      function _alert(e)
          { 
          if (e.number != 8007) 
              {
              alert("Line: " + e.line + "\n\n" +  e, "Bug!", true); 
              }           
          }
      
      //////////////////////////////////////////////////////////////////////////
      function enable_notifier(event_name, script_name, event_class)
          {
          try 
              {
              for (var i = 0; i < app.notifiers.length; i++)
                  {
                  if (app.notifiers[i].event == event_name &&
                      File(app.notifiers[i].eventFile).fsName.toLowerCase() == File(script_name).fsName.toLowerCase())
                      {
                      if (!app.notifiersEnabled) app.notifiersEnabled = true;
                      return true;
                      }
                  }
      
              app.notifiers.add(event_name, File(script_name), event_class);
              app.notifiersEnabled = true;
              return true;
              }
          catch (e) { _alert(e); return false; }
          }
      
      //////////////////////////////////////////////////////////////////////////
      function disable_notifier(event_name, script_name, event_class)
          {
          try 
              {
              var ret = false;
      
              for (var i = 0; i < app.notifiers.length; i++)
                  {
                  if (app.notifiers[i].event == event_name &&
                      File(app.notifiers[i].eventFile).fsName.toLowerCase() == File(script_name).fsName.toLowerCase())
                      {
                      app.notifiers[i].remove();
                      ret = true;
                      }
                  }
      
              if (!app.notifiers.length) app.notifiersEnabled = false;
      
              return ret;
              }
          catch (e) { _alert(e); return false; }
          }
      
      //////////////////////////////////////////////////////////////////////////
      function k2s(key)
          {
          try 
              {
              var str = typeIDToStringID(key);
              var chr = typeIDToCharID(key);
      
              switch (chr)
                  {
                  case "Gd  ": str = "guide";  break;
                  case "Grn ": str = "green";  break;
                  case "Grns": str = "greens"; break;
                  case "Pnt ": str = "point";  break;
                  case "Rds ": str = "";       break;
                  }
      
              if (str) return "stringIDToTypeID(\"" + str + "\")";
              else if (chr) return "charIDToTypeID(\"" + chr + "\")";
              else return "Bug!";
              }
          catch (e) { throw(e); }
          }
      
      ////////////////////////////////////////////////////////////////////////////////////////////
      function dat(s)
          {
          try 
              {
              var ret = "String.fromCharCode(";
      
              for (var i = 0; i < s.length; i++) 
                  {
                  var h = s.charCodeAt(i).toString(16).toUpperCase();
                  if (h.length == 1) h = "0" + h;
                  ret += "0x" + h;
                  if (i != s.length-1) ret += ",";
                  }
      
              ret += ")";
              
              return ret;
              }
          catch (e) { throw(e); }
          }
      
      //////////////////////////////////////////////////////////////////////////
      function parse_desc(desc)
          {
          try 
              {
              var name = dsc_name + (dsc_numb?dsc_numb:"");
      
              var code = (dsc_numb?"":(tab + tab)) + "var " + name + " = new ActionDescriptor();";
      
              for (var i = 0; i < desc.count; i++)
                  {
                  var key  = desc.getKey(i);
                  var type = desc.getType(key);
      
                  var str = "// UNNKOWN TYPE!"; 
      
                  var var_numb;
      
                  switch (type) 
                      {
                      case DescValueType.OBJECTTYPE:    ++dsc_numb; var_numb = dsc_numb; str = parse_desc(desc.getObjectValue(key)) + "\n" + tab + tab + name + ".putObject(" + k2s(key)    + ", " + k2s(desc.getObjectType(key)) + ", " + dsc_name + (var_numb?var_numb:"") + ");"; break;
                      case DescValueType.LISTTYPE:      ++lst_numb; var_numb = lst_numb; str = parse_list(desc.getList(key))        + "\n" + tab + tab + name + ".putList("   + k2s(key)    + ", " + lst_name + (var_numb?var_numb:"") + ");"; break;
                      case DescValueType.REFERENCETYPE: ++ref_numb; var_numb = ref_numb; str = parse_ref(desc.getReference(key))    + "\n" + tab + tab + name + ".putReference(" + k2s(key) + ", " + ref_name + (var_numb?var_numb:"") + ");"; break;
      
                      case DescValueType.CLASSTYPE:        str = name + ".putClass(" + k2s(key) + ", " + k2s(desc.getClass(key))   + ");"; break;
                      case DescValueType.RAWTYPE:          str = name + ".putData("  + k2s(key) + ", " + dat(desc.getData(key))    + ");"; break;; 
      
                      case DescValueType.BOOLEANTYPE:      str = name + ".putBoolean("      + k2s(key) + ", " + desc.getBoolean(key)      + ");"; break;
                      case DescValueType.INTEGERTYPE:      str = name + ".putInteger("      + k2s(key) + ", " + desc.getInteger(key)      + ");"; break;
                      case DescValueType.DOUBLETYPE:       str = name + ".putDouble("       + k2s(key) + ", " + desc.getDouble(key)       + ");"; break;
                      case DescValueType.LARGEINTEGERTYPE: str = name + ".putLargeInteger(" + k2s(key) + ", " + desc.getLargeInteger(key) + ");"; break;
      
                      case DescValueType.STRINGTYPE:       str = name + ".putString(" + k2s(key) +          ", \"" + desc.getString(key) + "\");";  break;
                      case DescValueType.ALIASTYPE:        str = name + ".putPath("   + k2s(key) + ", new File(\"" + desc.getPath(key)   + "\"));"; break;
      
                      case DescValueType.UNITDOUBLE:       str = name + ".putUnitDouble(" + k2s(key) + ", " + k2s(desc.getUnitDoubleType(key))  + ", " + desc.getUnitDoubleValue(key)       + ");"; break;
                      case DescValueType.ENUMERATEDTYPE:   str = name + ".putEnumerated(" + k2s(key) + ", " + k2s(desc.getEnumerationType(key)) + ", " + k2s(desc.getEnumerationValue(key)) + ");"; break;
                      }
      
                  code += "\n" + tab + tab + str;
                  }
      
              return code;
              }
          catch (e) { _alert(e); throw(e); }
          }
      
      //////////////////////////////////////////////////////////////////////////
      function parse_list(list)
          {
          try 
              {
              var name = lst_name + (lst_numb?lst_numb:"");
              var code = "var " + name + " = new ActionList();";
      
              for (var i = 0; i < list.count; i++)
                  {
                  var type = list.getType(i);
      
                  var str = "// UNNKOWN TYPE!"; 
      
                  var var_numb;
      
                  switch (type) 
                      {
                      case DescValueType.OBJECTTYPE:    ++dsc_numb; var_numb = dsc_numb; str = parse_desc(list.getObjectValue(i)) + "\n" + tab + tab + name + ".putObject("    + k2s(list.getObjectType(i)) + ", " + dsc_name + (var_numb?var_numb:"") + ");"; break;
                      case DescValueType.LISTTYPE:      ++lst_numb; var_numb = lst_numb; str = parse_list(list.getList(i))        + "\n" + tab + tab + name + ".putList("      + lst_name + (var_numb?var_numb:"") + ");"; break;
                      case DescValueType.REFERENCETYPE: ++ref_numb; var_numb = ref_numb; str = parse_ref(list.getReference(i))    + "\n" + tab + tab + name + ".putReference(" + ref_name + (var_numb?var_numb:"") + ");"; break;
      
                      case DescValueType.CLASSTYPE:        str = name + ".putClass(" + k2s(list.getClass(i)) + ");"; break;
                      case DescValueType.RAWTYPE:          str = name + ".putData("  + dat(desc.getData(i))  + ");"; break;; 
      
                      case DescValueType.BOOLEANTYPE:      str = name + ".putBoolean("      + list.getBoolean(i)      + ");"; break;
                      case DescValueType.INTEGERTYPE:      str = name + ".putInteger("      + list.getInteger(i)      + ");"; break;
                      case DescValueType.DOUBLETYPE:       str = name + ".putDouble("       + list.getDouble(i)       + ");"; break;
                      case DescValueType.LARGEINTEGERTYPE: str = name + ".putLargeInteger(" + list.getLargeInteger(i) + ");"; break;
      
                      case DescValueType.STRINGTYPE:       str = name + ".putString(" +          "\"" + list.getString(i) + "\");";  break;
                      case DescValueType.ALIASTYPE:        str = name + ".putPath("   + "new File(\"" + list.getPath(i)   + "\"));"; break;
      
                      case DescValueType.UNITDOUBLE:       str = name + ".putUnitDouble(" + k2s(list.getUnitDoubleType(i))  + ", " + list.getUnitDoubleValue(i)       + ");"; break;
                      case DescValueType.ENUMERATEDTYPE:   str = name + ".putEnumerated(" + k2s(list.getEnumerationType(i)) + ", " + k2s(list.getEnumerationValue(i)) + ");"; break;
                      }
      
                  code += "\n" + tab + tab + str;
                  }
      
              return code;
              }
          catch (e) { _alert(e); throw(e); }
          }
      
      ////////////////////////////////////////////////////////////////////////////////////////////
      function parse_ref(ref)
          {
          try 
              {
              var name = ref_name + (ref_numb?ref_numb:"");
              var code = "var " + name + " = new ActionReference();";
      
              while (1)
                  {
                  var ok = true;
      
                  try { var type = ref.getForm(); } catch (e) { ok = false; }
                  if (!ok) break;
      
                  var str = "// UNNKOWN TYPE!"; 
      
                  switch (type) 
                      {
                      case ReferenceFormType.ENUMERATED: str = name + ".putEnumerated(" + k2s(ref.getDesiredClass()) + ", " + k2s(ref.getEnumeratedType()) + ", " + k2s(ref.getEnumeratedValue()) + ");"; break;
                      case ReferenceFormType.CLASSTYPE:  str = name + ".putClass("      + k2s(ref.getDesiredClass()) + ");"; break;
                      case ReferenceFormType.IDENTIFIER: str = name + ".putIdentifier(" + k2s(ref.getDesiredClass()) + ", " + ref.getIdentifier() + ");"; break;
                      case ReferenceFormType.INDEX:      str = name + ".putIndex("      + k2s(ref.getDesiredClass()) + ", " + ref.getIndex()      + ");"; break;
                      case ReferenceFormType.OFFSET:     str = name + ".putOffset("     + k2s(ref.getDesiredClass()) + ", " + ref.getOffset()     + ");"; break;
                      case ReferenceFormType.NAME:       str = name + ".putName("       + k2s(ref.getDesiredClass()) + ", \"" + ref.getName()   + "\");"; break;
                      case ReferenceFormType.PROPERTY:   str = name + ".putProperty("   + k2s(ref.getDesiredClass()) + ", " + k2s(ref.getProperty())  + ");"; break;
                      }
      
                  code += "\n" + tab + tab + str;
      
                  try { ref = ref.getContainer(); } catch (e) { ok = false; }
                  if (!ok) break;
                  }
      
              return code;
              }
          catch (e) { _alert(e); throw(e); }
          }
      
        • 1. Re: Script Events Listener
          geppettol66959005 Level 3

          I tried your script

          it does not work for me use mac with photoshop cc2014 2018

           

          this is the generated script

          I create level

          create curves

          and set curves

           

          ///////////////////////////////////////////////////////////////////////////////
          function make_09353293897584 ()
              {
              try {
                  var d = new ActionDescriptor();
                  var r = new ActionReference();
                  r.putClass(stringIDToTypeID("layer"));
                  d.putReference(stringIDToTypeID("null"), r);
                  d.putInteger(stringIDToTypeID("layerID"), 524);
                  executeAction(stringIDToTypeID("make"), d, DialogModes.NO);
                  }
              catch (e) { throw(e); }
              }
          
          
          ///////////////////////////////////////////////////////////////////////////////
          function mergeVisible_00810609897599 ()
              {
              try {
                  var d = new ActionDescriptor();
                  d.putBoolean(stringIDToTypeID("duplicate"), true);
                  executeAction(stringIDToTypeID("mergeVisible"), d, DialogModes.NO);
                  }
              catch (e) { throw(e); }
              }
          
          
          ///////////////////////////////////////////////////////////////////////////////
          function make_74433935759589 ()
              {
              try {
                  var d = new ActionDescriptor();
                  var r = new ActionReference();
                  r.putClass(stringIDToTypeID("adjustmentLayer"));
                  d.putReference(stringIDToTypeID("null"), r);
                  var d1 = new ActionDescriptor();
                  var d2 = new ActionDescriptor();
                  d2.putEnumerated(stringIDToTypeID("presetKind"), stringIDToTypeID("presetKindType"), stringIDToTypeID("presetKindDefault"));
                  d1.putObject(stringIDToTypeID("type"), stringIDToTypeID("curves"), d2);
                  d.putObject(stringIDToTypeID("using"), stringIDToTypeID("adjustmentLayer"), d1);
                  executeAction(stringIDToTypeID("make"), d, DialogModes.NO);
                  }
              catch (e) { throw(e); }
              }
          
          
          ///////////////////////////////////////////////////////////////////////////////
          function set_11158893955871 ()
              {
              try {
                  var d = new ActionDescriptor();
                  var r = new ActionReference();
                  r.putEnumerated(stringIDToTypeID("adjustmentLayer"), stringIDToTypeID("ordinal"), stringIDToTypeID("targetEnum"));
                  d.putReference(stringIDToTypeID("null"), r);
                  var d1 = new ActionDescriptor();
                  d1.putEnumerated(stringIDToTypeID("presetKind"), stringIDToTypeID("presetKindType"), stringIDToTypeID("presetKindCustom"));
                  var list = new ActionList();
                  var d2 = new ActionDescriptor();
                  var r1 = new ActionReference();
                  r1.putEnumerated(stringIDToTypeID("channel"), stringIDToTypeID("channel"), stringIDToTypeID("composite"));
                  d2.putReference(stringIDToTypeID("channel"), r1);
                  var list1 = new ActionList();
                  var d3 = new ActionDescriptor();
                  d3.putDouble(stringIDToTypeID("horizontal"), 0);
                  d3.putDouble(stringIDToTypeID("vertical"), 0);
                  list1.putObject(stringIDToTypeID("point"), d3);
                  var d4 = new ActionDescriptor();
                  d4.putDouble(stringIDToTypeID("horizontal"), 91);
                  d4.putDouble(stringIDToTypeID("vertical"), 103);
                  list1.putObject(stringIDToTypeID("point"), d4);
                  var d5 = new ActionDescriptor();
                  d5.putDouble(stringIDToTypeID("horizontal"), 182);
                  d5.putDouble(stringIDToTypeID("vertical"), 222);
                  list1.putObject(stringIDToTypeID("point"), d5);
                  var d6 = new ActionDescriptor();
                  d6.putDouble(stringIDToTypeID("horizontal"), 255);
                  d6.putDouble(stringIDToTypeID("vertical"), 255);
                  list1.putObject(stringIDToTypeID("point"), d6);
                  d2.putList(stringIDToTypeID("curve"), list1);
                  list.putObject(stringIDToTypeID("curvesAdjustment"), d2);
                  d1.putList(stringIDToTypeID("adjustment"), list);
                  d.putObject(stringIDToTypeID("to"), stringIDToTypeID("curves"), d1);
                  executeAction(stringIDToTypeID("set"), d, DialogModes.NO);
                  }
              catch (e) { throw(e); }
              }
          
          
          ///////////////////////////////////////////////////////////////////////////////
          function select_47530803643167 ()
              {
              try {
                  var d = new ActionDescriptor();
                  var r = new ActionReference();
                  r.putEnumerated(stringIDToTypeID("channel"), stringIDToTypeID("channel"), stringIDToTypeID("RGB"));
                  d.putReference(stringIDToTypeID("null"), r);
                  d.putBoolean(stringIDToTypeID("makeVisible"), false);
                  executeAction(stringIDToTypeID("select"), d, DialogModes.NO);
                  }
              catch (e) { throw(e); }
              }
          
          
          • 2. Re: Script Events Listener
            Kukurykus Adobe Community Professional

            I tested your script and it works, but didn't check yet how that works for many possible operations. I guess it works very good Now in geppettol66959005 output I noticed d.putInteger(stringIDToTypeID("layerID"), 524); line. That is surely record generated by new Photoshop CC. In CS6 you had either name of layer or layer Index. I'm just wondering that code couldn't be used with other document that has the same set of layers, because certain layer doesn't have 524 ID anymore. Isn't it badly designed? If we wanted to use that code for other document (same kind and order of layers we had to change ID to Index :/ If so the best would be if 'cleaner / converter' did that in its output, but I am not sure if I am correct about it?

             

            function make_09353293897584 () 
                { 
                try { 
                    var d = new ActionDescriptor(); 
                    var r = new ActionReference(); 
                    r.putClass(stringIDToTypeID("layer")); 
                    d.putReference(stringIDToTypeID("null"), r); 
                    d.putInteger(stringIDToTypeID("layerID"), 524); 
                    executeAction(stringIDToTypeID("make"), d, DialogModes.NO); 
                    } 
                catch (e) { throw(e); } 
                }
            
            • 3. Re: Script Events Listener
              r-bin Level 5

              What's wrong? )

              • 4. Re: Script Events Listener
                r-bin Level 5

                Did you compare the output to ScriptingListenerJS.log?

                I also noticed that especially on CS6 sometimes some events are skipped, especially: "set". The CC is better, but the "all" event works badly there. Therefore, it processes events only from the events_CC array.

                • 5. Re: Script Events Listener
                  geppettol66959005 Level 3

                  Nothing happens when I use it

                  to you the code I posted works?

                  • 6. Re: Script Events Listener
                    r-bin Level 5

                    I do not understand.

                    Maybe you forgot to put a call to the function you need from the log?

                     

                    1 person found this helpful
                    • 7. Re: Script Events Listener
                      geppettol66959005 Level 3

                      I noticed that if I delete the function

                      it works properly

                       

                           try {

                               var d = new ActionDescriptor ();

                               var r = new ActionReference ();

                               r.putClass (stringIDToTypeID ("layer"));

                               d.putReference (stringIDToTypeID ("null"), r);

                               d.putInteger (stringIDToTypeID ("layerID"), 524);

                               executeAction (stringIDToTypeID ("make"), d, DialogModes.NO);

                               }

                           catch (e) {throw (e); }

                       

                      Or if you call the function

                      it works properly

                      /////////////////////////////////////////////////////////////////////////////// 

                      function make_09353293897584 () 

                          { 

                          try { 

                              var d = new ActionDescriptor(); 

                              var r = new ActionReference(); 

                              r.putClass(stringIDToTypeID("layer")); 

                              d.putReference(stringIDToTypeID("null"), r); 

                              d.putInteger(stringIDToTypeID("layerID"), 524); 

                              executeAction(stringIDToTypeID("make"), d, DialogModes.NO); 

                              } 

                          catch (e) { throw(e); } 

                          } 

                       

                       

                      make_09353293897584 () 

                      • 8. Re: Script Events Listener
                        Tom Winkelmann Level 3

                        How did you call the functions? With?

                         

                        make_09353293897584 ()

                        mergeVisible_00810609897599 ()

                        make_74433935759589 ()

                        set_11158893955871 ()

                        select_47530803643167 ()

                        • 9. Re: Script Events Listener
                          r-bin Level 5

                          Dumb and Dumber.
                          Sorry

                          • 10. Re: Script Events Listener
                            Kukurykus Adobe Community Professional

                            Okey I tested that code I posted in reply No. 2 and I see there is no problem about, so all is okey

                            • 11. Re: Script Events Listener
                              geppettol66959005 Level 3

                              r-bin

                              you could enter the call to functions

                              in the script.

                               

                              Thank you

                              • 12. Re: Script Events Listener
                                r-bin Level 5

                                I'll post an updated version later.

                                • 13. Re: Script Events Listener
                                  geppettol66959005 Level 3

                                  I'm having problems with raw camera filter

                                  your script gives me this

                                   

                                    d.putString(charIDToTypeID("CP_D"), "54650A341B5B5CCAE8442D0B43A92BCE");
                                          d.putInteger(charIDToTypeID("PrVe"), 167772160);
                                          d.putString(charIDToTypeID("Rtch"), "");
                                          d.putString(charIDToTypeID("REye"), "");
                                          d.putString(charIDToTypeID("LCs "), "");
                                          d.putString(charIDToTypeID("Upri"), "<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.6-c140 79.160451, 2017/05/06-01:08:21        ">
                                   <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
                                    <rdf:Description rdf:about=""
                                      xmlns:crs="http://ns.adobe.com/camera-raw-settings/1.0/"
                                     crs:UprightVersion="151388160"
                                     crs:UprightCenterMode="0"
                                     crs:UprightCenterNormX="0.5"
                                     crs:UprightCenterNormY="0.5"
                                     crs:UprightFocalMode="0"
                                     crs:UprightFocalLength35mm="35"
                                     crs:UprightPreview="False"
                                     crs:UprightTransformCount="6"/>
                                   </rdf:RDF>
                                  </x:xmpmeta>
                                  ");
                                          d.putString(charIDToTypeID("GuUr"), "<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.6-c140 79.160451, 2017/05/06-01:08:21        ">
                                   <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
                                    <rdf:Description rdf:about=""
                                      xmlns:crs="http://ns.adobe.com/camera-raw-settings/1.0/"
                                     crs:UprightFourSegmentsCount="0"/>
                                   </rdf:RDF>
                                  </x:xmpmeta>
                                  ");
                                          executeAction(stringIDToTypeID("Adobe Camera Raw Filter"), d, DialogModes.NO);
                                  

                                   

                                   

                                  instead ScriptingListener

                                  give me this

                                      desc38.putString( idCP_D, """54650A341B5B5CCAE8442D0B43A92BCE""" );
                                      var idPrVe = charIDToTypeID( "PrVe" );
                                      desc38.putInteger( idPrVe, 167772160 );
                                      var idRtch = charIDToTypeID( "Rtch" );
                                      desc38.putString( idRtch, """""" );
                                      var idREye = charIDToTypeID( "REye" );
                                      desc38.putString( idREye, """""" );
                                      var idLCs = charIDToTypeID( "LCs " );
                                      desc38.putString( idLCs, """""" );
                                      var idUpri = charIDToTypeID( "Upri" );
                                      desc38.putString( idUpri, """<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.6-c140 79.160451, 2017/05/06-01:08:21        ">
                                   <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
                                    <rdf:Description rdf:about=""
                                      xmlns:crs="http://ns.adobe.com/camera-raw-settings/1.0/"
                                     crs:UprightVersion="151388160"
                                     crs:UprightCenterMode="0"
                                     crs:UprightCenterNormX="0.5"
                                     crs:UprightCenterNormY="0.5"
                                     crs:UprightFocalMode="0"
                                     crs:UprightFocalLength35mm="35"
                                     crs:UprightPreview="False"
                                     crs:UprightTransformCount="6"/>
                                   </rdf:RDF>
                                  </x:xmpmeta>
                                  """ );
                                      var idGuUr = charIDToTypeID( "GuUr" );
                                      desc38.putString( idGuUr, """<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.6-c140 79.160451, 2017/05/06-01:08:21        ">
                                   <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
                                    <rdf:Description rdf:about=""
                                      xmlns:crs="http://ns.adobe.com/camera-raw-settings/1.0/"
                                     crs:UprightFourSegmentsCount="0"/>
                                   </rdf:RDF>
                                  </x:xmpmeta>
                                  """ );
                                  executeAction( idAdobeCameraRawFilter, desc38, DialogModes.NO );
                                  

                                  are missing "" ""

                                  • 14. Re: Script Events Listener
                                    r-bin Level 5

                                    I'll fix it. )

                                     

                                     

                                    • 15. Re: Script Events Listener
                                      r-bin Level 5

                                      Updated version.

                                       

                                      <javascriptresource>
                                      <name>Script Events Listener...</name>
                                      <category>scriptevents</category>
                                      </javascriptresource>
                                      
                                      var _version = "0.02";
                                      
                                      var log_name = "~/Desktop/EventListener.log";
                                      
                                      var max_data_len = 10000; // Trims data to this value if they are longer. For example, with toolRecording
                                      
                                      var dsc_name = "d";
                                      var lst_name = "list";
                                      var ref_name = "r";
                                      
                                      var dsc_numb = 0;
                                      var lst_numb = -1;
                                      var ref_numb = -1;
                                      
                                      var tab = "    ";
                                      
                                      var silent = false;
                                      
                                      var events_CS6 = [ "All " ];
                                      
                                      var events_CC = ["TdT ", "Avrg", "Asrt", "Fbrs", "HsbP", "LghE", "Pnt ", "TxtF", "Vrtn", "BacL", "FilE", "ColE", "OpnU", "VnPt", "LqFy",
                                      "Illustrator Export.  This string makes me unique!",
                                      "22C3EEBF-A978-4ca9-91DF-E4F0CCEE5ACE",
                                      "733B7310-9259-48fd-8A07-24CF7521590D",
                                      "4059cf7a-9304-11d3-bd8d-0060b0a13dc4",
                                      "1CAB8255-B682-4EAD-8184-AC65030134D5",
                                      "ffcb20ee-4c1f-11e5-885d-feff819cdc9f",
                                      "12fb03a7-e9af-426a-8377-3d423d7303e6",
                                      "8cba8cd6-cb66-11d1-bc43-0060b0a13dc4",
                                      "0B71D221-F8CE-11d2-B21B-0008C75B322C",
                                      "a0754df2-9c60-4b64-a940-6a2bb1102652",
                                      "6f1c2cf5-4a97-4e32-8f59-f5d7a087adef",
                                      "9AA9D7D6-C209-494A-CC01-4E7D926DA642",
                                      "3caa3434-cb67-11d1-bc43-0060b0a13dc4",
                                      "8a761c74-f362-4a1b-a3f7-e779ab319a08",
                                      "e805a6ee-6d75-4b62-b6fe-f5873b5fdf20",
                                      "CA37AEAF-6272-41F7-8258-F272711964E2",
                                      "1F9021B1-5045-42E1-AE2A-7E504FAA8D50",
                                      "cf34b502-2013-4d07-8431-1dfd634ee0cd",
                                      "B20FB700-B96A-4C10-B666-8C9B9DEF594E",
                                      "9AA9D7D6-C209-494A-BED9-4E7D926DA69F",
                                      "08E8421B-976E-4E81-A964-AD754EDB4381",
                                      "6F17BFA7-EFC8-40EA-B850-7B95ED8EA713",
                                      "9D3174CE-045C-4B87-B7AE-40D8C3319780",
                                      "0f9db13f-a772-4035-9020-840f0e5e2f02",
                                      "808034C2-162D-481B-88D4-B3EF294EDE42",
                                      "20489C30-9DB1-4DAD-B685-513A8C0543B9",
                                      "SaveForWeb",
                                      "Adobe Camera Raw Filter",
                                      "CropPhotos0001",
                                      "AdobeExposureMergeUI",
                                      " JPEG 2000",
                                      "CropPhotosAuto0001",
                                      "AdobeScriptAutomation Scripts",
                                      "WIAWizard0001",
                                      "Adobe Camera Raw",
                                      "export3DSingleMesh",
                                      "set3DUnits",
                                      "renderUVVertexColors",
                                      "print3D",
                                      "cancelPrint3D",
                                      "print3DProperties",
                                      "setPrint3DProperties",
                                      "print3DUtilities",
                                      "bake3DCrossSection",
                                      "bakeFor3DPrinting",
                                      "upload3DToSketchFab",
                                      "set3DSkeletalAnimation",
                                      "set3DFacialExpressionAnimation",
                                      "GetBuiltInMixamoSearches",
                                      "SearchMixamo",
                                      "GetLastMixamoResults",
                                      "GetMixamoThumbnailPath",
                                      "ApplyMixamoPreset",
                                      "GetMixamoParameters",
                                      "SetMixamoParameter",
                                      "sceneToGroup",
                                      "set3DMeshGroupSwitch",
                                      "set3DGroupSwitch",
                                      "simplify3DModel",
                                      "merge3DMaterials",
                                      "repair3DModel",
                                      "create3DFromDepthSolidExtrusion",
                                      "create3DFromDepthTwoSidedSolidExtrusion",
                                      "create3DFromRGBD",
                                      "New3DRepoussePreset",
                                      "Save3DRepoussePresets",
                                      "Delete3DRepoussePreset",
                                      "DeleteAll3DRepoussePresets",
                                      "Restore3DRepoussePresets",
                                      "Rename3DRepoussePresets",
                                      "objectGroup",
                                      "objectReorder",
                                      "objectBake",
                                      "replaceMesh",
                                      "materialSwitch",
                                      "objectUnGroup",
                                      "objectInstance",
                                      "objectReplicate",
                                      "objectSceneNew",
                                      "objectSceneNewFile",
                                      "packTo3DGroundPlane",
                                      "projectionPaintToggle",
                                      "select3DInstances",
                                      "select3DReference",
                                      "center3DMesh",
                                      "set3DPrintScale",
                                      "add3DRigToMesh",
                                      "convertJSONdescriptor",
                                      "applyBrushFile",
                                      "artboardFromLayerGroupEvent",
                                      "artboardFromLayersEvent",
                                      "brushSelectionModeAdd",
                                      "brushSelectionModeRefine",
                                      "brushSelectionModeReplace",
                                      "brushSelectionModeSubtract",
                                      "changePathDetails",
                                      "clearAllGuides",
                                      "clearCanvasGuides",
                                      "clearSelectedArtboardGuides",
                                      "conditional",
                                      "convertColorToSpace",
                                      "copyLayerCSS",
                                      "copyLayerSVG",
                                      "decoRenderFlame",
                                      "decoRenderPictureFrame",
                                      "decoRenderTree",
                                      "definePatternFile",
                                      "deleteTimeline",
                                      "duplicateAudioClips",
                                      "editArtboardEvent",
                                      "enableExtendedNotification",
                                      "fixMissingLinkedAssets",
                                      "flushImageChangedEvents",
                                      "focusMask",
                                      "generate",
                                      "generateAssets",
                                      "generatorTrackingEnable",
                                      "hitTest",
                                      "jsonAction",
                                      "collapseAllGroupsEvent",
                                      "licensed",
                                      "isolateLayers",
                                      "deIsolateLayers",
                                      "makerColorLookupLayerFromFile",
                                      "makeFrameAnimation",
                                      "makePatternLayerFromFile",
                                      "makeTimeline",
                                      "newArtboardGuidesFromTarget",
                                      "newArtboardEvent",
                                      "newDocPresetJSON",
                                      "newGuideLayout",
                                      "newGuidesFromTarget",
                                      "nodeConnection",
                                      "nodeMenuInitialize",
                                      "nodeMenu",
                                      "nodePluginInitialize",
                                      "nodePlugin",
                                      "oilPaint",
                                      "packageFile",
                                      "reorderFX",
                                      "placedLayerConvertToEmbedded",
                                      "placedLayerConvertToLinked",
                                      "placedLayerEmbedAll",
                                      "placedLayerRelinkToFile",
                                      "placedLayerRelinkToLibraries",
                                      "placedLayerReplaceMissing",
                                      "placedLayerRevealInOS",
                                      "placedLayerUpdateAllModified",
                                      "placedLayerUpdateModified",
                                      "progressFinish",
                                      "progressStart",
                                      "progressUpdate",
                                      "pushToDesignLibraries",
                                      "rasterizeAllPlaced",
                                      "remapFonts",
                                      "resetDocumentChanged",
                                      "resolveFontsDialog",
                                      "perspectiveWarpTransform",
                                      "sanitizeFileForTemplate",
                                      "saveBrushFile",
                                      "sendLayerThumbnailToNetworkClient",
                                      "sendLayerShapeToNetworkClient",
                                      "sendDocumentInfoToNetworkClient",
                                      "sendJSONToNetworkClient",
                                      "setOverscrollMode",
                                      "setPanZoom",
                                      "setPlacedLayerComp",
                                      "shapeClipboardOperation",
                                      "smartBrushWorkspace",
                                      "smartBrushClearSelectionEvent",
                                      "smartBrushResetSelectionEvent",
                                      "syncManageAcct",
                                      "syncSettings",
                                      "syncSettingsPush",
                                      "syncSettingsPull",
                                      "typekitMarketingDialog",
                                      "textCharStyleImport",
                                      "textPgphStyleImport",
                                      "textLoadDefaultTypeStyles",
                                      "textSaveDefaultTypeStyles",
                                      "textThumbnail",
                                      "textToClipboard",
                                      "thumbnailStyleFile",
                                      "timelineEnable3DTracksKeys",
                                      "toolRecording",
                                      "undoWhile3DPainting",
                                      "unzip",
                                      "writePatternToFile",
                                      "FuntaFormat",
                                      "exportDocumentAsFileTypePressed",
                                      "exportSelectionAsFileTypePressed",
                                      "exportDocumentAsDialog",
                                      "exportSelectionAsDialog",
                                      "framedGroupFromLayerGroupEvent",
                                      "framedGroupFromLayersEvent",
                                      "newFramedGroupEvent",
                                      "editFramedGroupEvent",
                                      "autoCutout",
                                      "ImportPanorama",
                                      "ExportPanorama",
                                      "create3DFromPanorama",
                                      "key3DState",
                                      "key3DObjectSelect",
                                      "keyGetSelected3DObject",
                                      "MixamoNotifier",
                                      "keyMapClass",
                                      "adaptCorrectTones",
                                      "autoFixCorrectTones",
                                      "jumpto",
                                      "setTimelineTransitionProperties",
                                      "setVideoClipVideoProperties",
                                      "setVideoClipAudioProperties",
                                      "setAudioClipProperties",
                                      "32BitPreviewOptions",
                                      "set3DGlobalAmbient",
                                      "set3DBackgroundType",
                                      "set3DBackgroundCount",
                                      "set3DDisableColorLinearization",
                                      "add3DLayerFromFile",
                                      "open3DLayerTexture",
                                      "save3DTextures",
                                      "export3DModel",
                                      "createPathFrom3D",
                                      "reload3DModel",
                                      "toggle3DTexture",
                                      "resumeFinal3DRender",
                                      "render3DSelection",
                                      "splitRepousseMesh",
                                      "toggle3DTextures",
                                      "create3DPostcard",
                                      "create3DTiledPainting",
                                      "createVolume",
                                      "set3DLightImageType",
                                      "insertGroundPlane",
                                      "3DRenderQualityPaint",
                                      "3DRenderQualityModel",
                                      "3DRenderQualityARTDraft",
                                      "3DRenderQualityARTFinal",
                                      "renderUVWireframe",
                                      "renderUVShaded",
                                      "renderUVNormalMap",
                                      "renderUVBrushStrokes",
                                      "set3DCamera",
                                      "set3DObjectPosition",
                                      "set3DCrossSection",
                                      "set3DLightMode",
                                      "set3DRenderMode",
                                      "set3DEngine",
                                      "set3DPaintType",
                                      "set3DTransferFunction",
                                      "add3DView",
                                      "delete3DView",
                                      "add3DObjectPosition",
                                      "delete3DObjectPosition",
                                      "set3DLightSwitch",
                                      "set3DLightPosition",
                                      "set3DLightDirection",
                                      "set3DLightType",
                                      "set3DLightColor",
                                      "set3DLightHotspotAngle",
                                      "set3DLightFalloffAngle",
                                      "set3DLightInnerRadius",
                                      "set3DLightOuterRadius",
                                      "set3DLightIntensity",
                                      "set3DLightCastsShadowsSwitch",
                                      "set3DLightAttenuationSwitch",
                                      "set3DLightAttenuationType",
                                      "set3DLightAttenuationCoeff",
                                      "set3DLightSoftShadows",
                                      "set3DMeshPosition",
                                      "set3DGroupPosition",
                                      "set3DMeshAlignmentEdges",
                                      "set3DMeshAlignmentCenters",
                                      "set3DMeshDistribution",
                                      "set3DMeshSwitch",
                                      "set3DMeshShadowCatcher",
                                      "set3DMeshShadowOpacity",
                                      "set3DMeshShadowCasting",
                                      "set3DMeshShadowInvisible",
                                      "set3DMaterialSwitch",
                                      "set3DMaterialScalar",
                                      "set3DMaterialColor",
                                      "set3DMaterialTexturePath",
                                      "set3DMaterialTextureInfo",
                                      "set3DPaintFalloff",
                                      "hideAll3DSelected",
                                      "hideTop3DSelected",
                                      "hide3DEnclosedOnly",
                                      "revealAll3D",
                                      "invert3DSelected",
                                      "paint3DDiffuse",
                                      "paint3DEnvironment",
                                      "paint3DBump",
                                      "paint3DSpecular",
                                      "paint3DOpacity",
                                      "paint3DShininess",
                                      "paint3DSelfIllumination",
                                      "paint3DReflection",
                                      "paint3DNormal",
                                      "renderSettings3D",
                                      "reparameterize3DModel",
                                      "create3DFromDepthPlane",
                                      "create3DFromDepthTwoSidedPlane",
                                      "create3DFromDepthCylinder",
                                      "create3DFromDepthSphere",
                                      "create3DFromRepousseText",
                                      "create3DFromRepousseWorkPath",
                                      "create3DFromRepousseSheetMask",
                                      "create3DFromRepousseAISO",
                                      "create3DFromRepousseSelection",
                                      "createConstraintFromWorkPath",
                                      "createConstraintFromSelection",
                                      "repousseInflationSide",
                                      "repousseBevelSide",
                                      "repousseInflationHeight",
                                      "repousseInflationAngle",
                                      "repousseBevelWidth",
                                      "repousseBevelAngle",
                                      "repousseBevelCountour",
                                      "repousseExtrusionHeight",
                                      "repousseExtrusionXAngle",
                                      "repousseExtrusionYAngle",
                                      "repousseExtrusionXYAngle",
                                      "repousseExtrusionScale",
                                      "repousseExtrusionTwist",
                                      "repousseExtrusionOrigin",
                                      "repousseExtrusionTextureType",
                                      "repousseExtrusionShear",
                                      "repousseMeshQuality",
                                      "repousseConstraintType",
                                      "repousseConstraintHeight",
                                      "repousseConstraintAngle",
                                      "repousseConstraintSide",
                                      "repousseConstraintDelete",
                                      "repousseConstraintPosition",
                                      "repoussePreset",
                                      "repousseNewPaths",
                                      "repousseLoadPresets",
                                      "repousseReplacePresets",
                                      "objectDelete",
                                      "objectNew",
                                      "objectRename",
                                      "add3DLightsFromPreset",
                                      "delete3DLightsPreset",
                                      "addPathToRepousse",
                                      "dropTo3DGroundPlane",
                                      "replace3DLightsFromPreset",
                                      "replace3DMaterialFromPreset",
                                      "save3DLightsToPreset",
                                      "select3DPaintable",
                                      "browse3DOnline",
                                      "autoHide3D",
                                      "New3DMaterialPreset",
                                      "Save3DMaterialPresets",
                                      "Load3DMaterialPresets",
                                      "Replace3DMaterialPresets",
                                      "Delete3DMaterialPreset",
                                      "DeleteAll3DMaterialPresets",
                                      "Restore3DMaterialPresets",
                                      "Rename3DMaterialPresets",
                                      "addAudioClipsToTimeline",
                                      "addClipsToTimeline",
                                      "addLayerFromFile",
                                      "addLayerFromViewlessDoc",
                                      "addTimelineTransition",
                                      "closeViewlessDocument",
                                      "colorLookup",
                                      "Dicom",
                                      "getTransforms",
                                      "GIFFormat",
                                      "openViewlessDocument",
                                      "ID",
                                      "JPEGTileExport",
                                      "NTSCColors",
                                      "NTSC",
                                      "PDFExport",
                                      "PSOpenFileDialog",
                                      "accentedEdges",
                                      "adaptCorrect",
                                      "addLayerTogroupByDrag",
                                      "addNoise",
                                      "add",
                                      "addBlankVideoLayer",
                                      "addTo",
                                      "addVideoLayer",
                                      "align",
                                      "alignment",
                                      "angledStrokes",
                                      "animationFrameActivate",
                                      "animationFrameExtendSelection",
                                      "animationFramesFromLayers",
                                      "animationFramesToLayers",
                                      "animationMatchLayer",
                                      "animationPasteFrames",
                                      "animationSelectAll",
                                      "animationTween",
                                      "applyComp",
                                      "applyImageEvent",
                                      "applyImageStackPluginRenderer",
                                      "applyLocking",
                                      "apply",
                                      "applyStyle",
                                      "assignProfile",
                                      "autoFixCorrect",
                                      "bMPFormat",
                                      "basRelief",
                                      "batchFromDroplet",
                                      "batch",
                                      "surfaceBlur",
                                      "blackAndWhite",
                                      "blurEvent",
                                      "blurMethod",
                                      "blurMore",
                                      "border",
                                      "boxblur",
                                      "brightnessContrast",
                                      "brightnessEvent",
                                      "bringToFront",
                                      "canvasSize",
                                      "centerCropMarks",
                                      "chalkCharcoal",
                                      "channelMixer",
                                      "charcoal",
                                      "chrome",
                                      "clearBrushControls",
                                      "clearEvent",
                                      "clearRuler",
                                      "clearStyle",
                                      "clearWarning",
                                      "close",
                                      "clouds",
                                      "colorBalance",
                                      "colorHalftone",
                                      "colorPalette",
                                      "colorRange",
                                      "colorSampler",
                                      "coloredPencil",
                                      "combine",
                                      "conteCrayon",
                                      "contract",
                                      "convertMode",
                                      "convertAnimation",
                                      "convertTimeline",
                                      "convertToProfile",
                                      "copyBrushTexture",
                                      "copyEffects",
                                      "copyEvent",
                                      "copyKeyframes",
                                      "copyMerged",
                                      "copyToLayer",
                                      "countAuto",
                                      "countClear",
                                      "countAdd",
                                      "countDelete",
                                      "countMove",
                                      "countColor",
                                      "countGroupVisible",
                                      "countGroupMarkerSize",
                                      "countGroupFontSize",
                                      "countRenameGroup",
                                      "countAddGroup",
                                      "countDeleteGroup",
                                      "countSetCurrentGroup",
                                      "craquelure",
                                      "createDroplet",
                                      "createDuplicate",
                                      "Crop",
                                      "crosshatch",
                                      "crystallize",
                                      "curves",
                                      "customPattern",
                                      "custom",
                                      "cut",
                                      "cutToLayer",
                                      "cutout",
                                      "darkStrokes",
                                      "decontaminate",
                                      "deInterlace",
                                      "dePosterize",
                                      "defineBrush",
                                      "defineCustomShape",
                                      "definePattern",
                                      "defineSprayer",
                                      "defringe",
                                      "deleteAllAnnot",
                                      "deleteAudioClips",
                                      "deleteFrame",
                                      "deleteMeasurements",
                                      "delete",
                                      "deleteTransitions",
                                      "denoise",
                                      "desaturate",
                                      "deselect",
                                      "despeckle",
                                      "destWhiteMax",
                                      "differenceClouds",
                                      "diffuseGlow",
                                      "diffuse",
                                      "disable",
                                      "disableLayerFX",
                                      "disableLayerStyle",
                                      "disableSingleFX",
                                      "displace",
                                      "distort",
                                      "distortion",
                                      "distribute",
                                      "distribution",
                                      "divide",
                                      "documentTimelineSettings",
                                      "Draw",
                                      "dryBrush",
                                      "duplicateFrame",
                                      "duplicate",
                                      "dustAndScratches",
                                      "editComment",
                                      "editInImageReady",
                                      "editVariables",
                                      "emboss",
                                      "enable",
                                      "equalize",
                                      "exchange",
                                      "excludeIntersection",
                                      "expand",
                                      "exportDataSet",
                                      "exportMeasurements",
                                      "export",
                                      "exportTimelineComments",
                                      "exposure",
                                      "extractWorkArea",
                                      "extrude",
                                      "facet",
                                      "Fade",
                                      "feather",
                                      "Fl  ",
                                      "filmGrain",
                                      "filter",
                                      "findEdges",
                                      "findReplace",
                                      "flattenImage",
                                      "Flip",
                                      "floatWindow",
                                      "fragment",
                                      "fresco",
                                      "gaussianBlur",
                                      "get",
                                      "glass",
                                      "glowingEdges",
                                      "gradientClassEvent",
                                      "gradientMapEvent",
                                      "grain",
                                      "graphicPen",
                                      "green",
                                      "gridMinor",
                                      "groupEvent",
                                      "Grow",
                                      "halftoneScreen",
                                      "headlightsLog",
                                      "headlightsInfo",
                                      "healJPEG",
                                      "healSelection",
                                      "Hd  ",
                                      "highPass",
                                      "hueSaturation",
                                      "imageSize",
                                      "imageStackConvertSmartObject",
                                      "importAnnots",
                                      "importDataSets",
                                      "import",
                                      "importVideoTapestry",
                                      "importVideoToLayers",
                                      "inkOutlines",
                                      "insertBlankFrame",
                                      "interfaceIconFrameDimmed",
                                      "interfaceWhite",
                                      "interlace",
                                      "interpolation",
                                      "interpretFootage",
                                      "intersect",
                                      "intersectWith",
                                      "inverse",
                                      "invert",
                                      "groupLayersEvent",
                                      "ungroupLayersEvent",
                                      "lensFlare",
                                      "levels",
                                      "liftWorkArea",
                                      "lightFilterLightingEffects",
                                      "lightFilterExtractLight",
                                      "lightFilterExtractColor",
                                      "lightFilterGradient",
                                      "lightFilterGradientMagnitude",
                                      "Lnk ",
                                      "linkSelectedLayers",
                                      "enableLayerLink",
                                      "disableLayerLink",
                                      "selectAllLayers",
                                      "selectNoLayers",
                                      "findLayers",
                                      "showAlteredVideo",
                                      "hideAlteredVideo",
                                      "makeFramesFromLayers",
                                      "makeLayersFromFrames",
                                      "Mk  ",
                                      "manual",
                                      "matchColor",
                                      "maximumQuality",
                                      "maximum",
                                      "measurementScale",
                                      "measurementScaleMarker",
                                      "median",
                                      "menuItemClass",
                                      "mergeAlignedLayers",
                                      "mergeChannels",
                                      "mergeLayersNew",
                                      "mergeLayers",
                                      "mergeSpotChannel",
                                      "mergeVisible",
                                      "mezzotint",
                                      "minimum",
                                      "mosaicPlugin",
                                      "mosaic",
                                      "motionBlur",
                                      "move",
                                      "moveAllTime",
                                      "moveInTime",
                                      "moveKeyframes",
                                      "moveOutTime",
                                      "moveStartTime",
                                      "moveWorkArea",
                                      "neonGlow",
                                      "networkEventSubscribe",
                                      "networkEventUnsubscribe",
                                      "neutralizeColor",
                                      "newPlacedLayer",
                                      "Nxt ",
                                      "nextFrame",
                                      "nextKeyframe",
                                      "notePaper",
                                      "notify",
                                      "null",
                                      "oceanRipple",
                                      "offset",
                                      "Opn ",
                                      "paintDaubs",
                                      "paletteKnife",
                                      "pasteEffects",
                                      "pasteInto",
                                      "pasteKeyframes",
                                      "pasteOutside",
                                      "paste",
                                      "patchSelection",
                                      "recomposeSelection",
                                      "patchwork",
                                      "perspectiveCrop",
                                      "photoFilter",
                                      "photocopy",
                                      "pinch",
                                      "placeEvent",
                                      "placeMeasurementScaleMarker",
                                      "placedLayerMakeCopy",
                                      "placedLayerEditContents",
                                      "placedLayerExportContents",
                                      "placedLayerReplaceContents",
                                      "plaster",
                                      "plasticWrap",
                                      "Ply ",
                                      "playbackStrokeFromFile",
                                      "pointillize",
                                      "polar",
                                      "posterEdges",
                                      "posterization",
                                      "posterize",
                                      "previous",
                                      "previousFrame",
                                      "previousKeyframe",
                                      "printOneCopy",
                                      "print",
                                      "profileToProfile",
                                      "proofSetup",
                                      "purge",
                                      "quit",
                                      "radialBlur",
                                      "rasterizeAll",
                                      "rasterizeLayer",
                                      "vectorStrokeToFill",
                                      "rasterizeLinked",
                                      "rasterizePlaced",
                                      "rasterize",
                                      "rasterizeTypeLayer",
                                      "rasterizeVideo",
                                      "recapture",
                                      "recordMeasurements",
                                      "refineSelectionEdge",
                                      "reloadFrame",
                                      "removeBlackMatte",
                                      "removeClipMotionProperties",
                                      "removeLayerMask",
                                      "removeWhiteMatte",
                                      "rename",
                                      "replaceColor",
                                      "replaceFootage",
                                      "replace",
                                      "replaceAudioClip",
                                      "replaceSubstitutes",
                                      "resetFromComp",
                                      "resetGPUStats",
                                      "reset",
                                      "resetDocumentFormatStr",
                                      "resize",
                                      "restoreAllFrames",
                                      "restoreFrame",
                                      "reticulation",
                                      "revealAll",
                                      "reverse",
                                      "revert",
                                      "rigidTransform",
                                      "blurbTransform",
                                      "ripple",
                                      "rotateEventEnum",
                                      "roughPastels",
                                      "shapeBlur",
                                      "save",
                                      "scaleEffectsEvent",
                                      "scaleKeyframes",
                                      "select",
                                      "selectSimilarLayers",
                                      "selectiveColor",
                                      "selectLinkedLayers",
                                      "sendDocumentThumbnailToNetworkClient",
                                      "separationSetup",
                                      "set",
                                      "setClipMotionProperties",
                                      "setTransitionDuration",
                                      "sharpenEdges",
                                      "sharpenMore",
                                      "sharpen",
                                      "sharpness",
                                      "shearEd",
                                      "shear",
                                      "showColorPicker",
                                      "showFileBrowserPalette",
                                      "showMiniBridge",
                                      "Shw ",
                                      "similar",
                                      "smartBlur",
                                      "smartSharpen",
                                      "smoothness",
                                      "smudgeStick",
                                      "solarize",
                                      "spatter",
                                      "spellCheck",
                                      "spherize",
                                      "splitChannels",
                                      "splitVideoLayer",
                                      "sponge",
                                      "sprayedStrokes",
                                      "stainedGlass",
                                      "stamp",
                                      "getGPUStats",
                                      "getGPUInfo",
                                      "startPaintProfiling",
                                      "startStrokeRecording",
                                      "stopPaintProfiling",
                                      "stopStrokeRecording",
                                      "Stop",
                                      "stroke",
                                      "subtractFrom",
                                      "subtract",
                                      "sumie",
                                      "supplementalCategories",
                                      "systemCall",
                                      "takeMergedSnapshot",
                                      "takeSnapshot",
                                      "targaFormat",
                                      "target",
                                      "texturizer",
                                      "thresholdClassEvent",
                                      "tiles",
                                      "togglePalettes",
                                      "tornEdges",
                                      "traceContour",
                                      "transform",
                                      "Trap",
                                      "trim",
                                      "trimDocumentToWorkArea",
                                      "twirl",
                                      "underpainting",
                                      "undoEvent",
                                      "ungroup",
                                      "unlink",
                                      "unlinkSelectedLayers",
                                      "unsharpMask",
                                      "updateLayouts",
                                      "updatePlacedLayer",
                                      "vibrance",
                                      "Wait",
                                      "waterPaper",
                                      "watercolor",
                                      "Wave",
                                      "Wnd ",
                                      "workspaceMenu",
                                      "zigZag",
                                      "helpLauncher",
                                      ]
                                      
                                      if (!arguments.length) 
                                          {
                                          var events = (parseInt(app.version)==13)?events_CS6:events_CC;
                                      
                                          var d = new Window("dialog", "Event Listener " + _version)
                                      
                                          d.orientation = "row";
                                          d.spacing = 20;
                                          d.margins = 20;
                                      
                                          var b1 = d.add("button", undefined, "Enable");
                                          var b2 = d.add("button", undefined, "Disable");
                                      
                                          b1.onClick = function()
                                              {
                                              d.close();
                                      
                                              for (var i = 0; i < events.length; i++) enable_notifier(events[i], $.fileName);
                                      
                                              alert("Event Listener Enabled!", " ")
                                              }
                                      
                                          b2.onClick = function()
                                              {
                                              d.close();
                                      
                                              for (var i = 0; i < events.length; i++) disable_notifier(events[i], $.fileName);
                                      
                                              alert("Event Listener Disabled!", " ")
                                              }
                                      
                                          d.show();
                                          }
                                      
                                      if (arguments.length >= 2) main(arguments[0], arguments[1]);
                                      
                                      //////////////////////////////////////////////////////////////////////////
                                      function main()
                                          {
                                          try 
                                              { 
                                              var func_name = typeIDToStringID(arguments[1]);
                                      
                                              if (!func_name) func_name = typeIDToCharID(arguments[1]);
                                      
                                              if (func_name.toLowerCase().indexOf("modalstate")    >= 0) return;
                                              if (func_name.toLowerCase().indexOf("invokecommand") >= 0) return;
                                              if (func_name.toLowerCase().indexOf("togglebrushesflyout") >= 0) return;
                                      
                                              func_name = func_name.replace(/^\s+/g, "");
                                              func_name = func_name.replace(/\s+$/g, "");
                                              func_name = func_name.replace(/\s/g, "_");
                                      
                                              var msg = null;
                                      
                                              if (!silent)           
                                                  {
                                                  msg = new Window("palette", "Event Listener", undefined, {independent:true} );
                                                  msg.preferredSize.width = 150;  
                                                  msg.txt = msg.add("statictext", undefined, func_name);
                                                  msg.show();
                                                  }
                                      
                                              var file = new File(log_name);
                                      
                                              file.open("a");
                                      
                                              file.writeln("///////////////////////////////////////////////////////////////////////////////");  
                                              file.writeln("(function " + func_name + "_" + Math.random().toString().substr(2) + "()");  
                                              file.writeln(tab + "{");  
                                              file.writeln(tab + "try {"); 
                                              file.writeln(parse_desc(arguments[0]));
                                              file.writeln(tab + tab + "executeAction(" + k2s(arguments[1]) + ", d, DialogModes.NO);");  
                                              file.writeln(tab + tab + "}");
                                              file.writeln(tab + "catch (e) { if (e.number!=8007) { alert(\"Line: \"+e.line+\"\\n\\n\"+e,\"Bug!\",true); throw(e); } }");
                                      
                                      
                                              file.writeln(tab + "}");
                                              file.writeln(")();");
                                              file.writeln("");
                                      
                                              file.close();
                                      
                                              if (msg)
                                                  {
                                                  msg.close();
                                                  msg = null;
                                                  }
                                              }
                                          catch (e) { _alert(e); }
                                          }
                                      
                                      //////////////////////////////////////////////////////////////////////////
                                      function _alert(e)
                                          { 
                                          if (e.number != 8007) 
                                              {
                                              alert("Line: " + e.line + "\n\n" +  e, "Bug!", true); 
                                              }           
                                          }
                                      
                                      //////////////////////////////////////////////////////////////////////////
                                      function enable_notifier(event_name, script_name, event_class)
                                          {
                                          try 
                                              {
                                              for (var i = 0; i < app.notifiers.length; i++)
                                                  {
                                                  if (app.notifiers[i].event == event_name &&
                                                      File(app.notifiers[i].eventFile).fsName.toLowerCase() == File(script_name).fsName.toLowerCase())
                                                      {
                                                      if (!app.notifiersEnabled) app.notifiersEnabled = true;
                                                      return true;
                                                      }
                                                  }
                                      
                                              app.notifiers.add(event_name, File(script_name), event_class);
                                              app.notifiersEnabled = true;
                                              return true;
                                              }
                                          catch (e) { _alert(e); return false; }
                                          }
                                      
                                      //////////////////////////////////////////////////////////////////////////
                                      function disable_notifier(event_name, script_name, event_class)
                                          {
                                          try 
                                              {
                                              var ret = false;
                                      
                                              for (var i = 0; i < app.notifiers.length; i++)
                                                  {
                                                  if (app.notifiers[i].event == event_name &&
                                                      File(app.notifiers[i].eventFile).fsName.toLowerCase() == File(script_name).fsName.toLowerCase())
                                                      {
                                                      app.notifiers[i].remove();
                                                      ret = true;
                                                      }
                                                  }
                                      
                                              if (!app.notifiers.length) app.notifiersEnabled = false;
                                      
                                              return ret;
                                              }
                                          catch (e) { _alert(e); return false; }
                                          }
                                      
                                      //////////////////////////////////////////////////////////////////////////
                                      function k2s(key)
                                          {
                                          try 
                                              {
                                              var str = typeIDToStringID(key);
                                              var chr = typeIDToCharID(key);
                                      
                                              switch (chr)
                                                  {
                                                  case "Gd  ": str = "guide";  break;
                                                  case "Grn ": str = "green";  break;
                                                  case "Grns": str = "greens"; break;
                                                  case "Pnt ": str = "point";  break;
                                                  case "Rds ": str = "";       break;
                                                  case "Intr": str = "";       break;
                                                  }
                                      
                                              if (str) return "stringIDToTypeID(\"" + str + "\")";
                                              else if (chr) return "charIDToTypeID(\"" + chr + "\")";
                                              else return "Bug!";
                                              }
                                          catch (e) { throw(e); }
                                          }
                                      
                                      ////////////////////////////////////////////////////////////////////////////////////////////
                                      function dat(s)
                                          {
                                          try 
                                              {
                                              var ret = "";
                                      
                                              var len = s.length;        
                                      
                                              if (len > max_data_len)
                                                  {
                                                  ret = "/* real data length = " + s.length + ", truncated to " + max_data_len + "*/ ";
                                      
                                                  len = max_data_len;
                                                  }
                                      
                                              ret += "String.fromCharCode(";
                                      
                                              for (var i = 0; i < len; i++) 
                                                  {
                                                  var h = s.charCodeAt(i).toString(16).toUpperCase();
                                                  if (h.length == 1) h = "0" + h;
                                                  ret += "0x" + h;
                                                  if (i != s.length-1) ret += ",";
                                                  }
                                      
                                              ret += ")";
                                              
                                              return ret;
                                              }
                                          catch (e) { throw(e); }
                                          }
                                      
                                      ////////////////////////////////////////////////////////////////////////////////////////////
                                      function src(s)
                                          {
                                          try 
                                              {
                                              s = s.toSource()
                                              s = s.replace(/^\(new String\("/, "");
                                              s = s.replace(/"))$/, "");
                                      
                                              return s;
                                              }
                                          catch (e) { throw(e); }
                                          }
                                      
                                      //////////////////////////////////////////////////////////////////////////
                                      function parse_desc(desc)
                                          {
                                          try 
                                              {
                                              var name = dsc_name + (dsc_numb?dsc_numb:"");
                                      
                                              var code = (dsc_numb?"":(tab + tab)) + "var " + name + " = new ActionDescriptor();";
                                      
                                              for (var i = 0; i < desc.count; i++)
                                                  {
                                                  var key  = desc.getKey(i);
                                                  var type = desc.getType(key);
                                      
                                                  var str = "// UNNKOWN TYPE!"; 
                                      
                                                  var var_numb;
                                      
                                                  switch (type) 
                                                      {
                                                      case DescValueType.OBJECTTYPE:    ++dsc_numb; var_numb = dsc_numb; str = parse_desc(desc.getObjectValue(key)) + "\n" + tab + tab + name + ".putObject(" + k2s(key)    + ", " + k2s(desc.getObjectType(key)) + ", " + dsc_name + (var_numb?var_numb:"") + ");"; break;
                                                      case DescValueType.LISTTYPE:      ++lst_numb; var_numb = lst_numb; str = parse_list(desc.getList(key))        + "\n" + tab + tab + name + ".putList("   + k2s(key)    + ", " + lst_name + (var_numb?var_numb:"") + ");"; break;
                                                      case DescValueType.REFERENCETYPE: ++ref_numb; var_numb = ref_numb; str = parse_ref(desc.getReference(key))    + "\n" + tab + tab + name + ".putReference(" + k2s(key) + ", " + ref_name + (var_numb?var_numb:"") + ");"; break;
                                      
                                                      case DescValueType.CLASSTYPE:        str = name + ".putClass(" + k2s(key) + ", " + k2s(desc.getClass(key))   + ");"; break;
                                                      case DescValueType.RAWTYPE:          str = name + ".putData("  + k2s(key) + ", " + dat(desc.getData(key))    + ");"; break;; 
                                      
                                                      case DescValueType.BOOLEANTYPE:      str = name + ".putBoolean("      + k2s(key) + ", " + desc.getBoolean(key)      + ");"; break;
                                                      case DescValueType.INTEGERTYPE:      str = name + ".putInteger("      + k2s(key) + ", " + desc.getInteger(key)      + ");"; break;
                                                      case DescValueType.DOUBLETYPE:       str = name + ".putDouble("       + k2s(key) + ", " + desc.getDouble(key)       + ");"; break;
                                                      case DescValueType.LARGEINTEGERTYPE: str = name + ".putLargeInteger(" + k2s(key) + ", " + desc.getLargeInteger(key) + ");"; break;
                                      
                                                      case DescValueType.STRINGTYPE:       str = name + ".putString(" + k2s(key) +          ", \"" + src(desc.getString(key)) + "\");";  break;
                                                      case DescValueType.ALIASTYPE:        str = name + ".putPath("   + k2s(key) + ", new File(\"" + src(desc.getPath(key))   + "\"));"; break;
                                      
                                                      case DescValueType.UNITDOUBLE:       str = name + ".putUnitDouble(" + k2s(key) + ", " + k2s(desc.getUnitDoubleType(key))  + ", " + desc.getUnitDoubleValue(key)       + ");"; break;
                                                      case DescValueType.ENUMERATEDTYPE:   str = name + ".putEnumerated(" + k2s(key) + ", " + k2s(desc.getEnumerationType(key)) + ", " + k2s(desc.getEnumerationValue(key)) + ");"; break;
                                                      }
                                      
                                                  code += "\n" + tab + tab + str;
                                                  }
                                      
                                              return code;
                                              }
                                          catch (e) { _alert(e); throw(e); }
                                          }
                                      
                                      //////////////////////////////////////////////////////////////////////////
                                      function parse_list(list)
                                          {
                                          try 
                                              {
                                              var name = lst_name + (lst_numb?lst_numb:"");
                                              var code = "var " + name + " = new ActionList();";
                                      
                                              for (var i = 0; i < list.count; i++)
                                                  {
                                                  var type = list.getType(i);
                                      
                                                  var str = "// UNNKOWN TYPE!"; 
                                      
                                                  var var_numb;
                                      
                                                  switch (type) 
                                                      {
                                                      case DescValueType.OBJECTTYPE:    ++dsc_numb; var_numb = dsc_numb; str = parse_desc(list.getObjectValue(i)) + "\n" + tab + tab + name + ".putObject("    + k2s(list.getObjectType(i)) + ", " + dsc_name + (var_numb?var_numb:"") + ");"; break;
                                                      case DescValueType.LISTTYPE:      ++lst_numb; var_numb = lst_numb; str = parse_list(list.getList(i))        + "\n" + tab + tab + name + ".putList("      + lst_name + (var_numb?var_numb:"") + ");"; break;
                                                      case DescValueType.REFERENCETYPE: ++ref_numb; var_numb = ref_numb; str = parse_ref(list.getReference(i))    + "\n" + tab + tab + name + ".putReference(" + ref_name + (var_numb?var_numb:"") + ");"; break;
                                      
                                                      case DescValueType.CLASSTYPE:        str = name + ".putClass(" + k2s(list.getClass(i)) + ");"; break;
                                                      case DescValueType.RAWTYPE:          str = name + ".putData("  + dat(desc.getData(i))  + ");"; break;; 
                                      
                                                      case DescValueType.BOOLEANTYPE:      str = name + ".putBoolean("      + list.getBoolean(i)      + ");"; break;
                                                      case DescValueType.INTEGERTYPE:      str = name + ".putInteger("      + list.getInteger(i)      + ");"; break;
                                                      case DescValueType.DOUBLETYPE:       str = name + ".putDouble("       + list.getDouble(i)       + ");"; break;
                                                      case DescValueType.LARGEINTEGERTYPE: str = name + ".putLargeInteger(" + list.getLargeInteger(i) + ");"; break;
                                      
                                                      case DescValueType.STRINGTYPE:       str = name + ".putString(" +          "\"" + src(list.getString(i)) + "\");";  break;
                                                      case DescValueType.ALIASTYPE:        str = name + ".putPath("   + "new File(\"" + src(list.getPath(i))   + "\"));"; break;
                                      
                                                      case DescValueType.UNITDOUBLE:       str = name + ".putUnitDouble(" + k2s(list.getUnitDoubleType(i))  + ", " + list.getUnitDoubleValue(i)       + ");"; break;
                                                      case DescValueType.ENUMERATEDTYPE:   str = name + ".putEnumerated(" + k2s(list.getEnumerationType(i)) + ", " + k2s(list.getEnumerationValue(i)) + ");"; break;
                                                      }
                                      
                                                  code += "\n" + tab + tab + str;
                                                  }
                                      
                                              return code;
                                              }
                                          catch (e) { _alert(e); throw(e); }
                                          }
                                      
                                      ////////////////////////////////////////////////////////////////////////////////////////////
                                      function parse_ref(ref)
                                          {
                                          try 
                                              {
                                              var name = ref_name + (ref_numb?ref_numb:"");
                                              var code = "var " + name + " = new ActionReference();";
                                      
                                              while (1)
                                                  {
                                                  var ok = true;
                                      
                                                  try { var type = ref.getForm(); } catch (e) { ok = false; }
                                                  if (!ok) break;
                                      
                                                  var str = "// UNNKOWN TYPE!"; 
                                      
                                                  switch (type) 
                                                      {
                                                      case ReferenceFormType.ENUMERATED: str = name + ".putEnumerated(" + k2s(ref.getDesiredClass()) + ", " + k2s(ref.getEnumeratedType()) + ", " + k2s(ref.getEnumeratedValue()) + ");"; break;
                                                      case ReferenceFormType.CLASSTYPE:  str = name + ".putClass("      + k2s(ref.getDesiredClass()) + ");"; break;
                                                      case ReferenceFormType.IDENTIFIER: str = name + ".putIdentifier(" + k2s(ref.getDesiredClass()) + ", " + ref.getIdentifier() + ");"; break;
                                                      case ReferenceFormType.INDEX:      str = name + ".putIndex("      + k2s(ref.getDesiredClass()) + ", " + ref.getIndex()      + ");"; break;
                                                      case ReferenceFormType.OFFSET:     str = name + ".putOffset("     + k2s(ref.getDesiredClass()) + ", " + ref.getOffset()     + ");"; break;
                                                      case ReferenceFormType.NAME:       str = name + ".putName("       + k2s(ref.getDesiredClass()) + ", \"" + src(ref.getName()) + "\");"; break;
                                                      case ReferenceFormType.PROPERTY:   str = name + ".putProperty("   + k2s(ref.getDesiredClass()) + ", " + k2s(ref.getProperty())  + ");"; break;
                                                      }
                                      
                                                  code += "\n" + tab + tab + str;
                                      
                                                  try { ref = ref.getContainer(); } catch (e) { ok = false; }
                                                  if (!ok) break;
                                                  }
                                      
                                              return code;
                                              }
                                          catch (e) { _alert(e); throw(e); }
                                          }
                                      

                                       

                                       

                                      EDIT:

                                      Was updated. See reply Re: Script Events Listener

                                      1 person found this helpful
                                      • 16. Re: Script Events Listener
                                        r-bin Level 5

                                        If the previous version was in the "Enabled" state, then it must be done "Disabled", before installing a new script.

                                        • 17. Re: Script Events Listener
                                          SuperMerlin Level 5

                                          I find this script very useful and I like to have the functions available in ExtendScript Toolkit so with the following script it can load the log into a new window.

                                           

                                          //file location =
                                          // C:\Program Files (x86)\Adobe\Adobe ExtendScript Toolkit CC\Required
                                          extrasESTK = {};
                                          extrasESTK.menus = {};
                                          try {
                                              extrasESTK.menus.extras = new MenuElement( "menu", "Extra", "at the end of menubar", "extrasESTK" );
                                              extrasESTK.menus.rbin= new MenuElement( "command", "Event Listener Log", "at the end of extrasESTK", "extrasESTK/eventLog" );
                                              } catch ( e ) {alert( e );}
                                              
                                          extrasESTK.menus.rbin.onSelect =function(){
                                          var file = new File("~/Desktop/EventListener.log");  
                                          file.open("r");
                                          var data = file.read();
                                          file.close();
                                          docMgr.create("Log", data + '\n');
                                          }
                                          

                                           

                                          A restart of ExtendScript is required to pick up the new script.

                                          A new menu Extra will be created.

                                          1 person found this helpful
                                          • 18. Re: Script Events Listener
                                            geppettol66959005 Level 3

                                            Now it works better

                                             

                                             

                                            but I find 2 anomalies

                                            the first anomaly and that when I enable or disable the script

                                            takes more than 1 minute to operate

                                             

                                            the second anomaly

                                            and that gives me error

                                             

                                            // script

                                            ///////////////////////////////////////////////////////////////////////////////
                                            (function make_06444563623518()
                                                {
                                                try {
                                                    var d = new ActionDescriptor();
                                                    var r = new ActionReference();
                                                    r.putClass(stringIDToTypeID("layer"));
                                                    d.putReference(stringIDToTypeID("null"), r);
                                                    d.putInteger(stringIDToTypeID("layerID"), 524);
                                                    executeAction(stringIDToTypeID("make"), d, DialogModes.NO);
                                                    }
                                                catch (e) { if (e.number!=8007) { alert("Line: "+e.line+"\n\n"+e,"Bug!",true); throw(e); } }
                                                }
                                            )()
                                            
                                            ///////////////////////////////////////////////////////////////////////////////
                                            (function mergeVisible_1378087089397()
                                                {
                                                try {
                                                    var d = new ActionDescriptor();
                                                    d.putBoolean(stringIDToTypeID("duplicate"), true);
                                                    executeAction(stringIDToTypeID("mergeVisible"), d, DialogModes.NO);
                                                    }
                                                catch (e) { if (e.number!=8007) { alert("Line: "+e.line+"\n\n"+e,"Bug!",true); throw(e); } }
                                                }
                                            )()
                                            

                                             

                                            error

                                            Schermata 2018-03-27 alle 11.47.40.png

                                            • 19. Re: Script Events Listener
                                              SuperMerlin Level 5

                                              Here is a script for Photoshop, that will be available in the HELP menu.

                                              You can clear the log and toggle notifiers also show the log.

                                              /* 
                                              <javascriptresource> 
                                              <name>Event Listener Log</name> 
                                              <about>Events Listener written by r-bin</about> 
                                              <menu>help</menu> 
                                              </javascriptresource> 
                                              */
                                              var win = new Window("dialog","Details");
                                              win.status = win.add("statictext",undefined,"");
                                              win.status.graphics.font = ScriptUI.newFont("Tahoma", 0, 20);
                                              win.status.preferredSize=[760,25];
                                              win.p1= win.add("panel", undefined, undefined, {borderStyle:"black"}); 
                                              win.g1 = win.p1.add('group');
                                              win.g1.orientation = "row";
                                              win.g1.lb1 = win.g1.add("edittext",undefined,undefined,{multiline: true});
                                              win.g1.lb1.graphics.font = ScriptUI.newFont("Tahoma", 0, 14);
                                              win.g1.lb1.preferredSize=[800,700];
                                              win.buttons =win.g1.add('group');
                                              win.buttons.orientation = "column";
                                              win.buttons.alignment="fill","left";
                                              win.buttons.alignChildren ="fill";
                                              win.buttons.bu1 = win.buttons.add("button",undefined,"Clear Log");
                                              win.buttons.log = win.buttons.add("button",undefined,"Toggle Log");
                                              win.buttons.buD = win.buttons.add("button",undefined,"Done");
                                              win.status.text ="Functions from log file - Log is running = " + app.notifiersEnabled;
                                              win.buttons.buD.onClick=function(){
                                                  win.close(0);
                                                  }
                                              win.buttons.bu1.onClick=function(){
                                                  var file = new File("~/Desktop/EventListener.log");  
                                                  file.open("w");
                                                  file.close();
                                                  win.status.text = win.status.text +" (Log cleared)";
                                                  }
                                              win.buttons.log.onClick=function(){
                                                  app.notifiersEnabled = !app.notifiersEnabled;
                                                  win.status.text ="Functions from log file - Log is running = " + app.notifiersEnabled;
                                                  }
                                              var file = new File("~/EventListener.log");  
                                              file.open("r");
                                              var data = file.read();
                                              file.close();
                                              win.g1.lb1.text=data;
                                              data=[];
                                              win.show();
                                              
                                              
                                              • 20. Re: Script Events Listener
                                                r-bin Level 5

                                                Damn it!

                                                Please correct the line in the script

                                                 

                                                file.writeln(")()");


                                                to

                                                 

                                                file.writeln(")();");

                                                 

                                                In occasion of long start in СС2018.
                                                I do not know how to speed it up, because the "all" event does not work out all the events. It looks like some kind of bug. Also there is a bug if among the added events there is already an event "all", then it can not be deleted via Script Events Manager correctly. It is always "reborn"

                                                 

                                                P.S. updated the post with the script

                                                • 21. Re: Script Events Listener
                                                  geppettol66959005 Level 3

                                                  Now it's okay

                                                  Schermata 2018-03-27 alle 12.43.36.png

                                                  but the gallery filters are not inserted

                                                  • 22. Re: Script Events Listener
                                                    r-bin Level 5

                                                    You can manually add events that are not caught in the events_CC array using the code from ScriptingListenerJS.log
                                                    For the filter gallery, this will be "GEfc".

                                                     

                                                    1 person found this helpful
                                                    • 23. Re: Script Events Listener
                                                      r-bin Level 5

                                                      I'm not ready to upload a new version yet. I do not like such a large number of events. And many of them will never happen, and some are not on the list. In most cases these are those events that do not have stringID, but only charID.

                                                       

                                                      But you can speed up the launch by changing the old code in the if (!arguments.length) block to this one.

                                                       

                                                      if (!arguments.length) 
                                                          {
                                                          var events = (parseInt(app.version)==13)?events_CS6:events_CC;
                                                      
                                                          var d = new Window("dialog", "Event Listener " + _version)
                                                      
                                                          d.orientation = "row";
                                                          d.spacing = 20;
                                                          d.margins = 20;
                                                      
                                                          var b1 = d.add("button", undefined, "Enable");
                                                          var b2 = d.add("button", undefined, "Disable");
                                                      
                                                          b1.onClick = function()
                                                              {
                                                              d.close();
                                                      
                                                              app.notifiers.removeAll();
                                                      
                                                              var file = new File($.fileName);
                                                      
                                                              for (var i = 0; i < events.length; i++) app.notifiers.add(events[i], file);
                                                      
                                                              app.notifiersEnabled = true;
                                                      
                                                              file = null;
                                                      
                                                              alert("Event Listener Enabled!", " ")
                                                              }
                                                      
                                                          b2.onClick = function()
                                                              {
                                                              d.close();
                                                      
                                                              app.notifiersEnabled = false;
                                                              app.notifiers.removeAll();
                                                      
                                                              alert("Event Listener Disabled!", " ")
                                                              }
                                                      
                                                          d.show();
                                                          }
                                                      

                                                       

                                                      Turns on much faster. Turns off instantly.

                                                       

                                                      In this case, the functions enable_notifier and disable_notifier can be removed from the code (not used)

                                                      1 person found this helpful
                                                      • 24. Re: Script Events Listener
                                                        smithcgl9043167 Level 2

                                                        r-bin Congratulations! Thanks for sharing with us this Phenomenal Script! Very interesting, one of the best of all time, for me so far is working perfectly. SuperMerlin you were also great at adding your brilliant scripts to this beautiful project. I did other tests here, I found this little error when inserting an image in the document:

                                                        Screenshot_1.jpg

                                                        Before you can post any updates, see if you can fix them. Thank you

                                                        • 25. Re: Script Events Listener
                                                          r-bin Level 5

                                                          OK. This is a bug! )
                                                          While I did not post the new version, you can fix it yourself

                                                          Replace this sequence

                                                          src(desc.getPath(key))

                                                          to

                                                          desc.getPath(key)


                                                          and

                                                          src(list.getPath(i))

                                                          to

                                                          list.getPath(i)
                                                          1 person found this helpful
                                                          • 26. Re: Script Events Listener
                                                            geppettol66959005 Level 3

                                                            r-bin

                                                            I prefer to use the first code that is faster

                                                            and slowly enter the items I need

                                                             

                                                            the work done up to now and excellent

                                                             

                                                            Thanks for sharing

                                                            • 27. Re: Script Events Listener
                                                              geppettol66959005 Level 3

                                                              A question

                                                              when clicking on the disable button, it removes all event scripts

                                                               

                                                              since I have some of my scripts in the events I would like these not to be removed

                                                              is there any way to do it?

                                                              • 28. Re: Script Events Listener
                                                                r-bin Level 5

                                                                Original versions 0.01 and 0.02 do not remove your notifiers. But you have to choose either the quick launch or your notifiers. I do not have time to script yet.

                                                                • 29. Re: Script Events Listener
                                                                  geppettol66959005 Level 3

                                                                  now I get it

                                                                  if I want to speed up I have to deactivate the notifiers

                                                                   

                                                                  if I want to have my events I have to activate notifiers

                                                                  but it becomes slower.

                                                                   

                                                                  thanks for everything

                                                                  • 30. Re: Script Events Listener
                                                                    Davide_Barranca Level 1

                                                                    Hi,

                                                                    if I may ask, why are you creating notifiers for all these events, instead of setting one notifier for everything ('All ')? On a Mac (at least mine), it gets quite slow.

                                                                    Thanks!

                                                                     

                                                                    Davide

                                                                    • 31. Re: Script Events Listener
                                                                      r-bin Level 5

                                                                      Because for СС2018 does not work as it should.

                                                                      For CS6, this is done in the same script.

                                                                       

                                                                      P.S. I still do not have time for this script.

                                                                      • 32. Re: Script Events Listener
                                                                        Kukurykus Adobe Community Professional

                                                                        I found not once that using event listener I have problem with more than few documents opened from Windows or from Windows by Photoshop (manually as well). When event listener is turned on it seems to open them in correct order but then when all are already opened script listener activates them all again (one by one). That would be after all acceptable, but problem is when they are beeing reactivated it happens in other order than when they are beeing opened. Sometimes it's same order, but mostly differs slightly and other time quite different.

                                                                         

                                                                        Generally that order is random, and sometimes they even are beeing opened not in the alphabetical order. What's wierd when I open one document and then change mode to Full Screen to open next files (still when Script listener is tunred on), then their order is kept as it should.

                                                                         

                                                                        Saying Script Listener I don't mean your script but generally commands available in Photoshop scripting. I tried to solve it somehow but all my attempts failed. So I started to search for similar problem on this forum and I ended up in this theard. I tried your script (from reply No. 15) and I found the same problem

                                                                         

                                                                        When your script is enabled (in CC 2018) please open (about 6 - 10) differently named files from the same location and tell me is their order the same as on disk when you look at them from Windows?

                                                                         

                                                                        If you understand me and see the same problem, do you know why it happens and how to solve it?

                                                                         

                                                                         

                                                                        You may also test it with line 866 changed to:

                                                                         

                                                                        if (arguments.length >= 2) alert(activeDocument.name), main(arguments[0], arguments[1]);
                                                                        
                                                                        • 33. Re: Script Events Listener
                                                                          r-bin Level 5

                                                                          Files open and remain open in the same sequence that I see in the window for opening files (in the same sorting as specified in the window). Another thing is that events after opening the last file are sent by Photoshop arbitrarily. This can be seen in the event_listener log or in ScriptingListenerJS.log for the ScriptListener.8li plugin. Perhaps this is a feature of Photoshop. I do not see what it can interfere with.

                                                                          • 34. Re: Script Events Listener
                                                                            Kukurykus Adobe Community Professional

                                                                            So I understand you noticed the same problem. After opening all files, event listener reactivates them in different order.

                                                                             

                                                                            The only cumbersome workaround I found is to add a command to activate them all again (starting from first opened to last one) each time after another of them is already opened. It works the way they are opened normally, but then each time Event Listener activates arbitary opened file it sort them from first to last one order.

                                                                             

                                                                            It's not good solution because that additional sorting happens for each file (so is time-consuming for many files, and visually that looks bad), and if there were already opened files in Photoshop which order was changed by us manually then the additional sorting files by their index is undesired behaviour.

                                                                             

                                                                            If you don't completetly understand that I write now and need some examples, I am going to provide them, but if you understand it do you know at least other workaround to solve it?

                                                                             

                                                                            For example do you think that would be possible that after opening by Photohsop all files the Event Listener ignores all of them beside last one?

                                                                             

                                                                             

                                                                            Ps. I may also post very simple script, as the problem is not literally connected to your script but behaviour of event listener implemented to Photoshop scripting.

                                                                            • 35. Re: Script Events Listener
                                                                              r-bin Level 5

                                                                              This does not event_listener "reactivates" them. This is Photoshop. Instead of the event_listener script, you can assign any script or action to the "Opn " command and get the same result too.

                                                                               

                                                                              The same incorrect opening sequence is present in ScriptingListenerJS.log.

                                                                              • 36. Re: Script Events Listener
                                                                                Kukurykus Adobe Community Professional

                                                                                Here is example:

                                                                                 

                                                                                1) I created .jpg files: a, b, c, d, e, f, and saved them on desktop

                                                                                2) then by Ps I opened them all at once (without custom event)

                                                                                3) they are always sorted in alphabetical order, so: a, b, c, d, e, f

                                                                                4) when I check ScriptListener log they usually have other order, like for ex.: c, e, b, d, f, a

                                                                                 

                                                                                The conclusion is, not Photoshop but ScriptListener plugin records other (arbitary) order of them.

                                                                                 

                                                                                 

                                                                                Now I created one-line script: alert(activeDocument.name), that I named 'one-line.jsx' and saved to:

                                                                                 

                                                                                'Presets\Scripts\Event Scripts Only' of Photoshop folder

                                                                                 

                                                                                After I relaunched Photoshop I enabled new 'Open' event from 'File / Scripts / Scripts Events Manager'

                                                                                 

                                                                                Then I repeated 4 steps from beginning of this post.

                                                                                 

                                                                                 

                                                                                In first instance they all were opened in alphabetical order, then arbitarily each of them was activated while name alerted.

                                                                                After each alert I could notice there was added new record in ScriptListener.log - so not right after openning them all.

                                                                                 

                                                                                 

                                                                                I did also experiment where I created new document, changed mode to Full Screen, then pressed Ctrl-O and selected those files to open. 'One-line.jsx' script was alerting them in arbitary order, but when all were opened and I changed mode back to Normal, they were sorted alphabeticaly. I guess it's not possible to enforce screen mode to full after opening first document.

                                                                                 

                                                                                 

                                                                                So:

                                                                                 

                                                                                1) Photoshop opens them corectely

                                                                                2) ScriptListener records in arbitary order

                                                                                3) if Event is enabled they are activated again in arbitary order too

                                                                                 

                                                                                 

                                                                                I also tried to open them not directly from Photoshop, but just from Windows or by Bridge. It did not help.

                                                                                I also removed ScriptListener Plugin and repeated above points. It still activated documents in wrong order.

                                                                                 

                                                                                 

                                                                                The final conclusion is that Photoshop Event Listener code is screwed up, isn't it?

                                                                                 

                                                                                Do you know how to access source code of 'Ps Event Listener' that I can perhpas fix?

                                                                                If that is not possible would you propose some workaround documents were activated correctly when 'Event' is enabled?

                                                                                • 37. Re: Script Events Listener
                                                                                  r-bin Level 5

                                                                                  What are you going to fix in the ScriptListener plugin? Need to fix photoshop )).
                                                                                  Write to any Action opening multiple files. You will see that the sequence will be broken. And at what here the ScriptListener plugin or my script?

                                                                                  I can not understand what this behavior bothers you?

                                                                                  • 38. Re: Script Events Listener
                                                                                    Kukurykus Adobe Community Professional

                                                                                    Hmmm I mentioned in my post that I deleted ScriptListener plugin, I mean that from 'Plugin' folder of main Photoshop folder. So it's not about ScriptListener plugin but some other 'listener' that is part of Photoshop.

                                                                                     

                                                                                    I noticed that Photoshop isn't broken like you say, because when you open a, b, c, d, e, f files they are opening in alphabetical order, aren't they? Only when you enable 'Event' to listen files you open, their order is going to be changed.

                                                                                     

                                                                                    So I don't want to fix ScriptListener plugin as I see it doesn't affect wrong order of files, but part of Photoshop that is responsible for listening (when listening is enabled).

                                                                                     

                                                                                    I also don't refer this problem directly to your script. I explained before it's not about your script, but similar problem that I noticed occurs also in your script.

                                                                                     

                                                                                    I gave already example of script to test the problem I met, you put to EventsScriptOnly folder: alert(activeDocument.name)

                                                                                     

                                                                                    however if you leave script empty, but enabled from Event Scripts Manager the effect will be the same. 'Alert' had only to help to notice that order is wrong.

                                                                                     

                                                                                    Probably I don't understand you, but if Photoshop is broken then why when you open files without enabled event listener (not yours) they are opened in correct order?

                                                                                     

                                                                                     

                                                                                    That bothers me as from time to time I still meet this problem by occasion of some scripts and I'm tired of it enough now. So I want some workaround at least...