4 Replies Latest reply on Aug 11, 2008 12:52 PM by Loic.Aigon

    CS2 Collect for Output

    hm_arul
      Hi scripters

      I am tring to create print package for my book. I have two or more chapaters in my book file, I want to create print package in each chapter name folder. Here I have started but I am stuck,

      bb = app.books[0].bookContents;

      app.scriptPreferences.userInteractionLevel = UserInteractionLevels.neverInteract;

      var myFolder = Folder.selectDialog("Please select a folder");

      for (i = 0; i < bb.length; i++)
      {
      app.open(bb[i].fullName);
      app.activeDocument.packageForPrint (myFolder, true, true, true, true, true, true,true);
      app.activeDocument.close;
      }

      Kindly any one tell me how I can?

      thanks

      regards
      a r u l
        • 1. Re: CS2 Collect for Output
          Loic.Aigon Adobe Community Professional
          Maybe what is a problem is the way you manage your package creation and closing the document.
          As you close the doc while incrementing from 0, the index of the next doc is always changing and the last index is not present anymore. So when the script try to reach this one it will fail.
          In this kind of cases, it's good to decrease from max to zero
          so you should have :
          for (i = bb.length-1; i >= 0; i--)
          etc.
          so when you close for example bb[26], bb[25] is still accessible.
          Hope it helps.
          Loic
          • 2. Re: CS2 Collect for Output
            hm_arul Level 1
            Thanks Loic

            It works, but when I am collecting output files I want to create seprate folder for each chapters. Finallay I the folder structure will be like this

            Indesign book
            book1.indb
            ch01.indd
            ch02.indd

            Root Folder
            ch01 Folder
            ch01 package files
            ch02 Folder
            ch02 package files

            Thanks

            regards
            a r u l
            • 3. Re: CS2 Collect for Output
              Loic.Aigon Adobe Community Professional
              Try this,
              I couldn't test it here
              var myFolder = Folder.selectDialog("Please select a folder");
              for (i = bb.length-1; i >=0 ; i--)
              {
              app.open(bb[i].fullName);
              var mychapterfolder = new Folder(myFolder.fullName + "/"+bb[i].name)
              mychapterfolder.create();
              app.activeDocument.packageForPrint (mychapterfolder, true, true, true, true, true, true,true);
              app.activeDocument.close;
              }
              Loic
              • 4. Re: CS2 Collect for Output
                Loic.Aigon Adobe Community Professional
                Did you get something ?
                Loic