1 Reply Latest reply on Oct 26, 2013 9:12 AM by try67

    Check if any jpg exist in the folder

    Jack Butler

      I want to check if there are any jpg's in folder, before curFolders.push(curhit[i]);

       

      function recursivehit(sourceFolder) {

          var mask = /\.(?:jpg)$/i;

          var curFolders = new Array();

          var curFiles = new Array();

          var curhit = sourceFolder.getFiles();

          var curPath = new Array();

          for (var i = 0; i < curShit.length; i++)

          {

            if (curhit[i] instanceof File) //if file

            {

              if (curhit[i].fullName.search(mask) != -1)

       

              {

                curFiles.push(curhit[i]);

              }

            }

            else if (curhit[i] instanceof Folder)//if folder

         

            {

              curFolders.push(curhit[i]);

            }

          }

       

      Can anyone help? ^^