1 Reply Latest reply on Jun 6, 2011 9:45 AM by csm_phil

    Model Number Index Help

    Billguidry

      I work at a company that creates large product catalogs in InDesign.  (Multiple 1k+ page catalogs)


      Is there any easy way (or script) to read our text boxes (stories) and spit out the Model# and Page number for each?


      Each product has a text box that is formated like this:


      Model No. (tab)    Color (tab)       Mfr. Retail:

      CA7592C   (tab)    Chrome (tab)    $500.00

      CA7592SL (tab)   Stainless (tab)   $550.00


      I'd like it to report out:

      CA7592C – p.472

      CA7592SL – p.472


      Can anyone point me in the right direction?  (links to read, scripts that might help)


      Thanks,

      Bill

        • 1. Re: Model Number Index Help
          csm_phil Level 4

          Hi Bill,

           

          I think you expect this? May be it will right you try this js code:

           

          Hope will helps!

           

           

          var myDoc = app.activeDocument;

           

          var Report = new File( "~/Desktop/Catalog_Report.txt" );
          Report .open( "w" );
          Report.writeln("\n*************  Document Name "+ myDoc.name+ "     *************\n");

           

          var myGraphics = myDoc.allGraphics;
          for (var i = myGraphics.length-1; i >= 0; i--) {
              var myFigure = myGraphics[i];
              page = myFigure;
              while (1){
                  if (page instanceof Document || page instanceof Spread || page instanceof Page)
                  break;
                  page = page.parent;
                  }
              Report.writeln((myFigure.itemLink.name+" — p."+ page.name+"\n"));
              }

          alert("Done");
          Report.writeln("__________________________________________________________\n\n");
          Report.close();
          Report.execute();

           

          csm_phil