8 Replies Latest reply on Jan 1, 2016 3:58 AM by tpk1982

    Script not running in CS5 version

    tpk1982 Level 4

      Hi,

       

      Wish you happy new year to all.

       

      I wrote a script which identify the images placed outside from main folder. I place all images where indesign document presents. If i place some images from other folder it will alert the names.

       

      Screen Shot 2016-01-01 at 12.36.24 PM.png    Screen Shot 2016-01-01 at 12.36.38 PM.png

       

      The script is working fine in CS6 and above but it is showing error in CS5. I opened from desktop. So it is not unsaved.

       

      Screen shot 2016-01-01 at 12.12.31 PM.png  

       

      My OS is:

      Screen shot 2016-01-01 at 12.12.54 PM.png

       

      The below coding is tried:

       

      getImagePaths()
      function getImagePaths(){
      var theLinks=app.documents[0].links;
      var myPath = app.activeDocument.filePath;
      var currPath, i;
      var str = "";
      var stert="";
      var flag=0;
      for(i=0;i<theLinks.length;i++)
      {
      currPath=File(theLinks[i].filePath).path;
          if(currPath.indexOf(myPath)==-1){
          stert=str + (theLinks[i].filePath+"\n");
          flag=1;
          }
          }
      if(flag==1){
      alert("Images from different folder: "+"\n"+stert)
      }
      else{
      alert("No Images from different folder");
      }
      }
      

       

       

      Thanks,

      Karthi