13 Replies Latest reply on Apr 21, 2016 4:35 AM by runew73276507

    Convert script to InDesign CS3

    runew73276507 Level 1

      This script works fine in CC2015 but I really need it to work in InDesign CS3 aswell - can anyone help me out?

       

      When I run the script in CS3 nothing happens - no errors and no alert though the document contains missing links and fonts.

       

      if (app.documents.length != 0)
      {
          var MY_DOC = app.activeDocument;
         var myLinks = MY_DOC.links;  
        
         var thePageNames = new Array();  
         for (var j = 0 ; j <= (myLinks.length - 1); j++)
         {  
              if(myLinks[j].status == LinkStatus.LINK_MISSING || myLinks[i].status == LinkStatus.LINK_OUT_OF_DATE == true){  
             try
             {   
                  thePageName = myLinks[j].parent.parentPage.documentOffset; 
             }
             catch (e)
             {    
                  continue; // must be on Pasteboard so ignore 
             }   
              thePageNames[thePageName] = 1 
           }    
         }    
      
          if (thePageNames.length != 0)
         {     
              var s = "";    
              for (i in thePageNames)
              {     
                  s = s + app.documents[0].pages[Number(i) - 1].name + ", ";    
              }    
              s = s.substring(0,s.length - 2);    
              if(!confirm("Missing or not updated links in document - continue?")) 
                  exit();   
              if(fun_FontMissing)
                   if(!confirm("Font missing in document - continue?")) 
                      exit();       
         } 
      } 
      
      function fun_FontMissing()
      {
          var isFontMis=false;   
          try{
              for(var i=0;i<MY_DOC.fonts.count();i++){
                  if(MY_DOC.fonts[i].status==1718832705 || MY_DOC.fonts[i].status == 1718834037 || MY_DOC.fonts[i].status == 1718830689){
                      isFontMis=true;
                  }
              }
          }
          catch(ex){
              alert(ex);
              exit();
          }
          return isFontMis;
      }