9 Replies Latest reply on Feb 16, 2016 6:25 AM by dersenn

    How can relink and renaming image

    karthiks94217840 Level 2

      Dear Friends,

       

      Hi all, I need to relink lots of -missing- images (i.e. "K_MNYCEPT221161_C01PT_002T.ai") to  (i.e. "K_MNLESE850231_C01PT_002T.ai"). I have listed my coding below, tell one good suggestion friends.

       

      Application version: Cs6 indesign

       

      var    
        mLinks = app.activeDocument.links.everyItem().getElements(),    
        cLink, cFile;    
       alert(mLinks.length)  
          
      while ( cLink = mLinks.pop() )   
        alert(cLink.length)  
      {    
        if (cLink.status == LinkStatus.NORMAL) continue;    
        cFile = File(cLink.name.replace("K_MNYCEPT221161_","K_MNLESE850231_") );   
        if ( !cFile.exists ) continue;    
        cLink.relink(cFile);    
        }  
      
      

       

      Thanks in advance,