1 Reply Latest reply on Aug 25, 2014 11:28 AM by pixxxel schubser

    [script] "if exists script" function

    efreetcs

      Hello,

       

      Is exists a function in javascript to verify if a script named X exists ?

       

      I want to check it, and if it exists, launch it :

       

      function executeScript(scriptName)
      {
          if (scriptExists(scriptName))
         {
              var desc = new ActionDescriptor();
                  desc.putString( idjsNm, scriptName );
              executeAction( idAdobeScriptAutomationScripts, desc, DialogModes.NO );
         }
      }
      
      function scriptExists(scriptName)
      {
          //
          // Verify if script named 'scriptName' exists, if true, return true, else return false
          //
         return false;
      }