2 Replies Latest reply on Apr 27, 2010 7:47 AM by Anna Nmty

    Is this possible?

    Anna Nmty Level 2

      Before I bury myself searching, learning, and splicing code together,  I just need to know if my task is solvable with a script. The task  seems perfect for scripting, but my InDesign scripting knowledge so far  is only cut 'n' paste from others' work.

       

      Task:

      For each .indd file in a folder, I  want to have a script open the file, update a link, save the file,  export the file to pdf with PressQuality settings, and close the file.

       

      Background:

      I  have 350 InDesign figures in one folder. Each figure has a link to an  Illustrator file located in the same folder and 2-3 links to pdf files  located in a subfolder called "embed".

        • 1. Re: Is this possible?
          [Jongware] Most Valuable Participant

          Absolutely possible.

           

          I would advise to not start with a complete script, but try each separate part one at a time:

           

          1. Getting a list of files

          2. Update one link in an already open file

          3. Export an opened file to PDF

          4. Close an opened file :-)

           

          If you have each of the parts working, copy them as separate functions into a single script, run this, sit back & have a well-deserved coffee.

           

          Let me get you started with (1). That's as simple as this -- remember, the processFile function should only be used if you know how to process one file; don't experiment with your entire set until you are (fairly) confident the rest works.

           

          var filenames = [ ];
          var folder = Folder("//c/Users/YourName/Documents");
          folderContents = folder.getFiles("*.indd");
          for (i=0; i<folderContents.length; i++)
          {
           filenames.push (folderContents[i]+"\n");
          // processFile(folderContents[i]));
          }
          alert (filenames.join("\r"));
          
          // Not used yet:
          function processFile (name)
          {
           var currentFile = app.open (name);
          // ..
           currentFile.close ();
          }
          
          • 2. Re: Is this possible?
            Anna Nmty Level 2

            Thank you for the hope and the start!

             

            I am planning to spend my lunches this week going trying to find ways to automate tasks and this task is top of my list as the deadline rapidly approaches.