5 Replies Latest reply on Apr 10, 2016 2:10 PM by kjvh

    Anyone laid out a membership directory? I need your advice.

    kjvh

      I have to lay out a 170ish-page membership directory for a national association.

       

      The bulk - about 90 pages - will be member listings, probably 4 cols on a standard 8.5x11 trimmed for bleeds, with other shorter listing categories (maybe 10-20 pages each).

       

      Here's a sample page from last year's - and sadly, the designer did not supply the working doc, so I'm starting from scratch.

       

      I would so appreciate your advice, wisdom, warnings and hard-knock do-it-this-way directives!

       

       

       

       

       

       

       

       

       

      dir.jpg

        • 1. Re: Anyone laid out a membership directory? I need your advice.
          Peter Spier Most Valuable Participant (Moderator)

          As it happens, I'm finishing up a (much shorter) directory now, and this will not be a fun project. I expect.

           

          I have a library of town headings (you'll want them for states), and my directory is built using data merge. First I run a single record per page merge because in my case the listings are numbered and indexed by names and business names, but you may not need to do that. Then I use a copy of that file and remove blank lines(I use the script from Re: Multiple record data merge into paragraph styles-applies the wrong style which removes blank fields and lines without screwing up the styles) then stitch the records together into a single story using this script which comes from the same discussion, but may not be in the thread in this form (and there are other stitching options mentioned in that thread). Note that the frames must be numbered for this script, which I do by adding a "stitch" field to my data set and make it the first paragraph -- it gets removed later with a simple find/change for paragraphs with only number:

           

          //StitchingTextFramesByNumbers_v3.jsx
          //Uwe Laubender
          //DESCRIPTION:Numbering MUST start with 0 or a POSITIVE integer number like 1. Gaps in numbering are allowed: 1,2,,,4. Already threaded text frames will be ignored
          
          /**
          * @@@BUILDINFO@@@ StitchingTextFramesByNumbers_v3.jsx !Version! Sun Dec 29 2013 14:37:29 GMT+0100
          */
          
          
          app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll;
          
          app.doScript(_StitchTextFramesByConsecutiveNumbers, ScriptLanguage.JAVASCRIPT, [], UndoModes.ENTIRE_SCRIPT, "Stitch text frames by numbers");
          
          function _StitchTextFramesByConsecutiveNumbers(){
              
          //Start time is:
          var start_time = Date.now();
          
          var d=app.documents[0],
              myIDArray = new Array(),
              allTFsL1 = d.textFrames,
              currentTF,
              nextTF,
              currentNumber,
              nextNumber,
              n = 0,
              myNumber,
              myResultString = "",
              myResultArrayOfStrings = new Array(),
              notStitchedNumber = 0,
              doubleNumbers = new Array(),
              myCurrentInteger 
          
          for(n=0;n1){
                  ++notStitchedNumber;
                  continue
                  };
              
              //Function returns an integer number or null:
              myNumber = strictTestForIntegerInFirstParagraph(allTFsL1[n]);
              
              //Case 2: if the strict test reveals no number in paragraph 1
              //or in case there is no paragraph at all (empty text frame):
              
              //ignore the text frame:
              if(myNumber == null){
                  ++notStitchedNumber;
                  continue
                  };
          
              //Feed the ID-Array so that the number is the index number of the array.
              //No need to have an extra sort! However "gaps" in the array are possible!
              
              //Let's test if a slot of the array is already occupied:
              try{
                  
              myCurrentInteger = parseInt(myIDArray[myNumber].toString(),10);
          
              if(!isNaN(myCurrentInteger)){
                  alert("WARNING!"+"\r"+"Number"+" "+myNumber+" "+"already processed. The corresponding text frame will not be stitched and marked with fill color: \"Magenta\".")
                  };
              doubleNumbers.push(myNumber);
              
              d.textFrames.itemByID(myIDArray[myNumber]).fillColor = "Magenta";
              
              }catch(e){};
              
              myIDArray[myNumber] = allTFsL1[n].id;
          
              
              if(allTFsL1[n].parentStory.characters[-1].contents != "\r"){
                  allTFsL1[n].parentStory.insertionPoints[-1].contents = "\r";
                  };
              
              };
          
          //Case: there are "gaps" in the numbering (e.g: [,1,2,,,5,6,7,,,,11])
          //Get rid of the empty slots in the array:
          
          myResultString = myIDArray.join("#").replace(/#+/g,"#");
          myResultArrayOfStrings = myResultString.split("#");
          
          if(String(myResultArrayOfStrings[0]) === ""){
              myResultArrayOfStrings.splice(0,1);
              };
          
          
          
          //Stitch together document wide:
          for(n=0;n
          

           

          once the stitching is done, I do a select all, copy, and paste into a new doc for the actual directory, uysing single column frames and autoflowing the bulk of the story after the initial paste, then I adjust frames and add my headings (you can probably just add them inline but I put them into separate frames so I can adjust spacing to balance columns and pages, which now that I think about it after doing it this way for years is probably a complete waste)

          • 2. Re: Anyone laid out a membership directory? I need your advice.
            Peter Spier Most Valuable Participant (Moderator)

            So it looks like the forum cut off about half the script when I put it in as preformatted, so maybe this will work, or Uwe can post it properly:

             

            //StitchingTextFramesByNumbers_v3.jsx

            //Uwe Laubender

            //DESCRIPTION:Numbering MUST start with 0 or a POSITIVE integer number like 1. Gaps in numbering are allowed: 1,2,,,4. Already threaded text frames will be ignored

             

            /**

            * @@@BUILDINFO@@@ StitchingTextFramesByNumbers_v3.jsx !Version! Sun Dec 29 2013 14:37:29 GMT+0100

            */

             

             

            app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll;

             

            app.doScript(_StitchTextFramesByConsecutiveNumbers, ScriptLanguage.JAVASCRIPT, [], UndoModes.ENTIRE_SCRIPT, "Stitch text frames by numbers");

             

            function _StitchTextFramesByConsecutiveNumbers(){

              

            //Start time is:

            var start_time = Date.now();

             

            var d=app.documents[0],

                myIDArray = new Array(),

                allTFsL1 = d.textFrames,

                currentTF,

                nextTF,

                currentNumber,

                nextNumber,

                n = 0,

                myNumber,

                myResultString = "",

                myResultArrayOfStrings = new Array(),

                notStitchedNumber = 0,

                doubleNumbers = new Array(),

                myCurrentInteger

             

            for(n=0;n<allTFsL1.length;n++){

                //Case 1: if text frame is part of a threaded story

                //ignore the text frame:

                if(allTFsL1[n].parentStory.textContainers.length > 1){

                    ++notStitchedNumber;

                    continue

                    };

              

                //Function returns an integer number or null:

                myNumber = strictTestForIntegerInFirstParagraph(allTFsL1[n]);

              

                //Case 2: if the strict test reveals no number in paragraph 1

                //or in case there is no paragraph at all (empty text frame):

              

                //ignore the text frame:

                if(myNumber == null){

                    ++notStitchedNumber;

                    continue

                    };

             

                //Feed the ID-Array so that the number is the index number of the array.

                //No need to have an extra sort! However "gaps" in the array are possible!

              

                //Let's test if a slot of the array is already occupied:

                try{

                  

                myCurrentInteger = parseInt(myIDArray[myNumber].toString(),10);

             

                if(!isNaN(myCurrentInteger)){

                    alert("WARNING!"+"\r"+"Number"+" "+myNumber+" "+"already processed. The corresponding text frame will not be stitched and marked with fill color: \"Magenta\".")

                    };

                doubleNumbers.push(myNumber);

              

                d.textFrames.itemByID(myIDArray[myNumber]).fillColor = "Magenta";

              

                }catch(e){};

              

                myIDArray[myNumber] = allTFsL1[n].id;

             

              

                if(allTFsL1[n].parentStory.characters[-1].contents != "\r"){

                    allTFsL1[n].parentStory.insertionPoints[-1].contents = "\r";

                    };

              

                };

             

            //Case: there are "gaps" in the numbering (e.g: [,1,2,,,5,6,7,,,,11])

            //Get rid of the empty slots in the array:

             

            myResultString = myIDArray.join("#").replace(/#+/g,"#");

            myResultArrayOfStrings = myResultString.split("#");

             

            if(String(myResultArrayOfStrings[0]) === ""){

                myResultArrayOfStrings.splice(0,1);

                };

             

             

             

            //Stitch together document wide:

            for(n=0;n<myResultArrayOfStrings.length-1;n++){

             

                currentNumber = Number(myResultArrayOfStrings[n]);

                nextNumber = Number(myResultArrayOfStrings[n+1]);

              

                currentTF = d.textFrames.itemByID(currentNumber);

                nextTF = d.textFrames.itemByID(nextNumber);

             

                currentTF.nextTextFrame = nextTF;

                };

             

            d.recompose();

             

            //Zeit auswerten:

            var end_time = Date.now();

            var elapsed_time = ((end_time - start_time)/1000)/60;

             

            //Function returns integer, if the contents of the first paragraph contains exactly an integer as string.

            //Function returns null, if not.

            function strictTestForIntegerInFirstParagraph(myTextFrame/*returns int || returns null*/){

              

                var myString, myInteger;

                if(myTextFrame.parentStory.paragraphs.length === 0){return null};

              

                myString = myTextFrame.parentStory.paragraphs[0].contents.replace(/\r$/,"");

                myInteger = parseInt(myString,10);

              

                if(isNaN(myInteger)){return null};

                else if(myInteger.toString().length < myString.length){return null};

                else {return myInteger};

              

            }; //END OF strictTestForIntegerInFirstParagraph(myTextFrame)

             

            function alert_scroll(/*String*/title,/*Array*/input){

              

                //FUNCTION alert_scroll(){}

                //Peter Kahrel

                //See discussions at:

                //http://forums.adobe.com/message/4393469#4393469

                //Marijan Tompa [Tomaxxi]

                //http://tomaxxi.com/2010/07/scrollable-alert/

              

               if(input instanceof Array){input = input.join ("\r")};

             

               var w = new Window("dialog", title);

             

               var list = w.add("edittext", undefined, input, {multiline: true, scrolling: true});

             

               list.maximumSize.height = w.maximumSize.height-100;

               list.minimumSize.width = 450;

               list.active = true;

             

               w.add("button", undefined, "Close", {name: "ok"});

               w.show();

                 

            }; //END OF function alert_scroll()

             

            alert_scroll(

                "StitchingTextFramesByNumbers_v3.jsx (© 2013 by Uwe Laubender)",

                [

                    "[Note] Just copy the results to the clipboard."+"\r",

                  

                    myResultArrayOfStrings.length+" "+"text frames STITCHED"+"\r",

                    notStitchedNumber+" "+"text frames NOT stitched, because no numbers found"+"\r",

                    doubleNumbers.length+" "+"DOUBLE NUMBERS!",

                    "The corresponding text frames are not stitched and marked with fill color \"Magenta\". List of double numbers:",

                    doubleNumbers.join(",")+"\r",

                    "Elapsed time:",

                    elapsed_time+" minutes"+"\r",

                    "Comments and bug reports are welcome.",

                    "Send me a personal message (PM) to my Adobe user name \"Laubender\" at:"+"\r",

                    "http://forums.adobe.com/community/indesign/indesign_scripting?view=discussions"

                ]

                );

             

            }; //END OF MAIN function _StitchTextFramesByConsecutiveNumbers()

            • 3. Re: Anyone laid out a membership directory? I need your advice.
              kjvh Level 1

              I never get anything but great advice here. I appreciate this! Thanks!

              • 4. Re: Anyone laid out a membership directory? I need your advice.
                Peter Spier Most Valuable Participant (Moderator)

                that thread I linked above is quite long, and gets technical at times, but if you can slog through it I think it would be worth your time.

                 

                And I'm sure there are other folks out there who have other, possibly better, ideas on how to do this, so don't just jump on what I said.

                • 5. Re: Anyone laid out a membership directory? I need your advice.
                  kjvh Level 1

                  The client found this coded-up remnant from a previous directory, which produced this printed page.

                   

                   


                  ^Alberta^

                  @Arrow-West Equipment Ltd.@

                  Len Chalupa, President

                  109 - 53016 Hwy 60

                  Acheson, AB T7X 5A7

                  780-962-4490;Fax:866-561-5667

                  +www.arrowwest.ca+

                  *Manufacturers Represented:@Allied Systems Co. % FMS Attachments % Paccar Winch Div. % Ryan Technologies Inc. % Weldco-Beales Mfg. Inc. %

                  ?

                  @C.E.M. Heavy Equipment@

                  Jennifer Valgardson, Owner/Partner

                  6001 50 Ave

                  Taber, AB T1G 1W7

                  866-397-4683;Fax:403-223-3682

                  +www.cemhe.com+

                  *Manufacturers Represented:@GEHL Equipment % Hyundai Construction Equipment %

                  ?

                  @Cervus Equipment Corporation@

                  Michael Havens, Branch Manager

                  5201 333 96 Ave NE

                  Calgary, AB T3K 0S3

                  403-567-0339;Fax:403-567-0392

                  +www.cervusequipment.com+

                  *Other Locations:@

                  ?

                  Ian Chambers, Branch Manager

                  270 Mackay Crescent

                  Fort McMurray, AB T9H 5C6

                  Fax:780-714-9202

                  ?

                  Daxter Schultz, Branch Manager

                  4403 - 112 Ave SE

                  Calgary, AB T2C 5C5

                  Fax:403-243-2068

                  ?

                  Pat Wight, Branch Manager

                  10 Burnt Park Dr

                  Red Deer, AB T4S 2L4

                  Fax:403-346-9051

                  ?

                  Michael Havens, Branch Manager

                  10942 97 Ave

                  Grand Prairie, AB T8V 3J8

                  ?

                  Kent Zinger,

                  14504 Yellow Head Trail

                  Edmonton, AB T5L 3C5

                  Fax:780-447-4441

                  *Manufacturers Represented:@Bobcat Co. % JCB Inc. %

                  ?

                  @ConTrac Equipment Ltd.@

                  Michael Karczmarczyk, President

                  220 Diamond Ave

                  Spruce Grove, AB T7X 4C7

                  780-960-9475;Fax:780-960-3407

                  +www.contraceq.ca+

                  ?

                  @Cubex Limited@

                  Bill Wilson, Owner

                  9304 Horton Rd SW

                  Calgary, AB T2V 2X4

                  877-462-8239;Fax:403-253-0164

                  +www.cubexltd.com+

                  *Other Locations:@

                  ?

                  7423 Wilson Ave

                  Delta, BC V4G 1E5

                  ?

                  189 Garden Ave

                  Brantford, ON N3S 0A7

                  ?

                  Stephane Bouchard, Branch Manager

                  850 Boucher St

                  St. Jean/Richelieu, QC J3P 7Z8

                  Fax:450-349-4155

                  ?

                  42 St. Paul Blvd

                  Winnepeg, MB R2P 2W5

                  ?

                  11720 181 St Northwest

                  Edmonton, AB T5S 1M6

                  *Manufacturers Represented:@Acker % Acker Drill Co. % Aries % Cubex Limited % Elgin Sweeper Co. % Elgin Sweeper Co. % Epoke % Gradall Industries, Inc. % HAMM Compactors, Inc. % Heil Refuse Products % Henke Manufacturing Corp. % Leach Co. % LeeBoy % Maclean Engineering % Rosco Manufacturing Co. % Schramm, Inc. % Schwarze Industries % Tiger Corp. % Trackless Vehicles Ltd. % Vacall % Vohl/RPM Tech. %

                  ?

                  @ELRUS Aggregate Systems@

                  Carollyne Coulson, President

                  4409 Glenmore Trail SE

                  Calgary, AB T2C 2R8

                  403-279-7741;Fax:403-236-5151

                  +www.elrus.com+

                  *Other Locations:@

                  ?

                  843 60th St E

                  Saskatoon, SK S7K 5Z7

                  ?

                  19066 95A Ave

                  Surrey, BC V4N 4P2

                  ?

                  170 Turnbull Court

                  Cambridge, ON N1T 1J2

                  ?

                  8401 39 St

                  Leduc, AB T9E 8M7

                  *Manufacturers Represented:@ELRUS Aggregate Systems % McLanahan Corp. % Sandvik Construction % Superior Industries of Morris, Inc. %

                  ?

                  @Emeco Canada Ltd.@

                  Chris Hayman, President

                  17420 Stony Plain Rd Ste 100

                  Edmonton, AB T5S 1K6

                  780-483-2942;Fax:780-489-7813

                  +www.emecogroup.com+

                  *Other Locations:@

                  ?

                  Lot 6, Caribou Industrial Park

                  Fort McKay, AB T0P 1C0

                  *Manufacturers Represented:@Diamond % Heavy Construction Equip. Rentals % Ryan Equipment % Weldco-Beales Mfg. Inc. %

                  ?

                  What I don't have is the InDesign file.  I'm out in the middle of a rough sea - any idea what i need to do to replicate for this year's directory?result.jpg

                   

                  You always answer the questions no one else knows the answers to, and I appreciate you greatly.