1 Reply Latest reply on Mar 24, 2014 8:13 AM by Javed_ali

    update images and save

    donatelo Level 1

      Hi I was wondering if any one knew how i would be able to get images to update on open by using a javascript?

      I have the javascript below that I have been trying to modify, that opens a single indesign file and saves it with modified images update. My only problem is that in will not do more than one file. If there are multiple  files in a folder it will only update the images in the first indesign file it finds. Is there a way to modify this script to update all the indesign files it finds in a folder? Any assistance you can offer with this problem would be greatly appreciated

      Thank you very much

       

      if($error == null)

      {

              try {

                      var theLinks = app.documents[0].links;

       

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

                      {

                              theLinks[0].update();

                      }      

              }

              catch(theError) {

                      app.documents[0].close(SaveOptions.no);

                      $error = theError.description;

              }

      }

        • 1. Re: update images and save
          Javed_ali Adobe Employee

          This traverses through all the files with extension indd in the folder you specify. You can write your code that opens the specified file in the for loop in the end

           

          ------------------------

          fold = new Folder(" folderPath here")

           

          allFiles = fold.getFiles("*.indd")

           

          for(i=0;i<allFiles.length;i++)

          {

                  //write your function here

          }

          ------------------------