38 Replies Latest reply on Apr 6, 2010 7:16 AM by Harbs.

    JS script to continue parallel column layout to new pages

    ScratchyBoy Level 1

      It seems lndesign doesn't automatically continue a layout to subsequent page pairs when your typing in one column wraps to the next page.  I was told I could script this, and since I have done JS scripting on web pages for a while, it should not be too hard, hopefully, if I explain the layout here?

       

      The layout is simple -- 4 parallel columns spread across 2 facing pages -- each column will hold a separate text than the other 3, and these texts will NOT be pasted in -- they will be created AS I type.  I can't find a word processor to do this, because none can wrap a column from one even page number to the next even page number (not the next odd page number).  Yet if you think about the layout in the finished printed book, it is very obvious -- you want the two texts on the left page to always stay on the left, and the two on the right to stay on the right, no matter which page of the book you turn to.

       

      So technically, column 1 of the even page 2 will wrap down to column 1 of page 4.  Column 2 of the even page will also wrap down to page 4.  Similarly, both the 2 right columns of the right (odd) page will always wrap down to the next odd page. All I need is for this to happen automatically as I type.  So, whatever column I am typing into, when I reach the end of that column on the current page, the same layout will be created for the next page pair on the fly.  So you just keep typing, and when ANY column hits the end of that page, a new page-pair layout will be created if it doesn't already exist.

       

      This avoides page frame linking repetitively across hundreds of pages, which is an ongoing hassle that will detract from my concentration on the book's content.  I want the layout to simply keep going in the background for as long as I type.  Simple requirement -- can it be done in Javascript?

        • 1. Re: JS script to continue parallel column layout to new pages
          Harbs. Level 6

          Unless you are a VERY advanced scripter and use APID, the best you 

          will be able to do would be to run a script to add new frames each 

          time the text gets overset.

           

          You could assign the script a shortcut, so it would be relatively 

          painless to run the script each time...

           

          Harbs

          • 2. Re: JS script to continue parallel column layout to new pages
            ScratchyBoy Level 1

            Too bad.  APID is?  Is the script you mentioned (to click as a shortcut) complicated?  Can you give any of it here?

             

            I will be doing several books with parallel column layout, so I really want to find a program where you set up a layout once, and it auto-propagates itself.  Other than our discussion on the other thread, and your suggestion there, do you know of any WPs or DTPs that can auto-propagate a fixed layout?  Or any other ways to do it in scripting?  After all, it is only page numbering -- but the on-screen layout is what I need to work with.

            • 3. Re: JS script to continue parallel column layout to new pages
              Harbs. Level 6

              I really don't have the time to write free scripts right now, but if you want to put in the effort to write this yourself, this should get you started:

               

              The basic skeleton of such a script would be something like this:

               

              var bounds = app.selection[0].parentTextFrames[0].geometricBounds;
              app.documents[0].pages.add();
              app.documents[0].pages.add();
              var nextFrame = app.documents[0].spreads[-1].textFrames.add({geometricBounds:bounds});
              app.selection[0].parentTextFrames[0].nextTextFrame = nextFrame;
              
              

               

              You need to make sure that the ruler origin is spread.

               

              You will need to check if there's a page after the current one, and only add the page if necessary.

               

              There's a whole pile of other error checking that you'd have to do as well.

               

              HTH,

              Harbs

              • 5. Re: JS script to continue parallel column layout to new pages
                ScratchyBoy Level 1

                Thanks Harbs, this is a useful start, and the first solid thing I have got so far.

                • 6. Re: JS script to continue parallel column layout to new pages
                  [Jongware] Most Valuable Participant

                  We're a helpful lot, generally. Really!

                   

                  As for your problem at hand, all you (hopefully!) have to do is modify the following script on one single little point. There might be more than 4 text frames on any page (I suppose...), so the script checks each one on the current spread for a certain minimum height in line 2. If the height is less than the number given (the sample shows "180", as I tested on an A5, and with millimeters), the frame will *not* be considered for linking. Don't worry if you don't get it right first time, as it also checks if the result *does* contain 4 frames, no more, no less.

                   

                  If it does find 4 frames, it sorts them from left to right according to their x position, so it's ensured the new frames are linked to the correct ones. (I suppose that's a fairly crucial point.) It then adds two more pages, creates four more text frames, and links these to the ones on the parent page.

                   

                   

                  // Get frames on current spread
                  allFrames = new Array;
                  itsSpread = app.selection[0];
                  if (itsSpread instanceof InsertionPoint)
                       itsSpread = itsSpread.parentTextFrames[0];
                  if (itsSpread instanceof TextFrame)
                       itsSpread = itsSpread.parent;
                  if (itsSpread instanceof Page)
                       itsSpread = itsSpread.parent;
                  if (!(itsSpread instanceof Spread))
                  {
                       alert ("Got lost somewhere ... Please put your cursor IN the text");
                       exit(0);
                  }
                  // alert (itsSpread.constructor.name);
                  // alert (app.selection[0].parentTextFrames[0].parent.constructor.name);
                  for (a=0; a<itsSpread.textFrames.length; a++)
                       allFrames.push(itsSpread.textFrames[a]);
                  // Discard small frames. Adjust for your document ...
                  for (a=allFrames.length-1; a>=0; a--)
                  {
                       if (allFrames[a].geometricBounds[2] - allFrames[a].geometricBounds[0] < 180)
                            allFrames.splice(a,1);
                  }
                  // alert (allFrames.length);
                  if (allFrames.length != 4)
                  {
                       alert ("Unable to find the 4 frames ...\n(Found "+allFrames.length+")");
                       exit(0);
                  }
                  
                  // Sort on x
                  allFrames.sort (function(a,b) { return a.geometricBounds[1] - b.geometricBounds[1]; } );
                  
                  // Dummy checking :-P
                  // for (a=0; a<4; a++)
                  //     allFrames[a].contents += String(a);
                  
                  // Add a page for frames 0,1
                  p = app.documents[0].pages.add();
                  // Add and link frames
                  bounds = allFrames[0].geometricBounds;
                  nextFrame = p.textFrames.add({geometricBounds:bounds});
                  allFrames[0].nextTextFrame = nextFrame;
                  
                  bounds = allFrames[1].geometricBounds;
                  nextFrame = p.textFrames.add({geometricBounds:bounds});
                  allFrames[1].nextTextFrame = nextFrame;
                  
                  // Add a page for frames 2,3
                  p = app.documents[0].pages.add();
                  // Add and link frames
                  bounds = allFrames[2].geometricBounds;
                  nextFrame = p.textFrames.add({geometricBounds:bounds});
                  allFrames[2].nextTextFrame = nextFrame;
                  
                  bounds = allFrames[3].geometricBounds;
                  nextFrame = p.textFrames.add({geometricBounds:bounds});
                  allFrames[3].nextTextFrame = nextFrame;
                  
                  
                  // That, as they say, should be It.
                   
                  

                  1 person found this helpful
                  • 7. Re: JS script to continue parallel column layout to new pages
                    [Jongware] Most Valuable Participant

                    Web Jive Editor strikes again. The line you should adjust is "22", and that's what I'm sure I typed! A reply rather than a post-edit, because I've seen Jive mangle edited posts beyond recognition

                    • 8. Re: JS script to continue parallel column layout to new pages
                      ScratchyBoy Level 1

                      Jongware --- This is ABSOLUTELY TERRIFIC -- much more than I had hoped for.  Thank you very much, the "correct answer" should surely have gone to you, but I expect it is too late to change it now.

                       

                      You are right in assuming there might be more than 4 frames -- there of course needs to be gutters between adjacent column, don't know if I need more frames for those until I try it.  But it sounds like you have already fielded that issue.  And you are also right in assuming that the most crucial thing is to wrap each column down to the next-page+1 -- keeping the odd page columns on odd pages, and the even on even.  That is really all there is to it.

                       

                      So now do I run this script on start up after making the initial layout? Or can I attached the script to the layout starting at p.2?  I want the script to automatically keep going, and I will have to experiment as to how to accomplish that. The 4 column layout starts on page 2, since page 1 is orphaned.  And from pages 2-3, it just keeps going as long as I am typing.

                       

                      Truly fantasic work.  This has finally got me excited enough to get going with Indesign.  I will keep you posted as it progresses.  You not only made my day, but if it works as intended, you will have made my year !!!

                      • 9. Re: JS script to continue parallel column layout to new pages
                        [Jongware] Most Valuable Participant

                        Glad you like it!

                         

                        So now do I run this script on start up after making the initial layout? Or can I attached the script to the layout starting at p.2?

                         

                        As it is now, the script will only work on your spread with two pages, four columns. I strongly suggest you only try it on the very last page (/spread), as I have no idea what will happen when you use it on a spread that already has something following it!

                         

                        To add a spread and have the frames continue, just make sure your text cursor is in one of the frames on your last page. Then double-click the script to insert a new spread after the current one (see above ...) and automatically link to it. If your currently visible text frames have any overset text, this will automagically appear on the new spread; otherwise, after running the script, you can just keep on typing and you'll jump over to the new spread when you fill the current frame.

                         

                        Harbs hinted at a more complicated setup, where the script would be running continously (? I think) and adds pages whenever it sees an overflow. I don't have any idea at all how one would achieve that; perhaps it's something in the APID toolkit he referred to. With my script, you have to "manually" add a spread every time the current one is full, or ... (hold on while I test that... )

                         

                        Okay. You have to be careful when adding pages! If you accidentally run the script twice, two more spreads will be added, and (quite logically, actually...) the frames on your current page will be linked to the last pages added, skipping the ones inbetween. So, with your text cursor inside a frame, don't run the script more than once -- the cursor determines 'from' what page to link, and it always links to the newly added pages.

                         

                        You can still add a bunch of empty pages, but you'll have to be a bit more careful. The script also works with a text frame selected (using the black arrow); and in that case, the selected frame is the 'source' for the next link. So to add more than one spread, select a frame on your last pages; run the script, press [Page Down] (it seems ID automatically goes to the new pages, but you'd better keep an eye on the Pages panel), select a frame on this new spread and run the script again.

                         

                        (Yup -- confirmed. Running the script on not-the-last-page messes up the text threading. Let me think.)

                        Aha! Text frames also have a property "endTextFrame", pointing directly to the final frame in its threads. Linking to that last frame always seems to work. If you change the "nextTextFrame" line four times, you'll no longer run the risk of making spaghetti of your threads:

                         

                        allFrames[0].endTextFrame.nextTextFrame = nextFrame;

                        (once for allFrames[0] to [3]).

                        • 10. Re: JS script to continue parallel column layout to new pages
                          [Jongware] Most Valuable Participant
                          You are right in assuming there might be more than 4 frames -- there of course needs to be gutters between adjacent column, don't know if I need more frames for those until I try it.

                           

                          My test setup was fairly simple: in the New Document dialog I changed the number of columns to "2", with some gutter. That makes ID draw guidelines for all four of your text frames. On your first spread, you have to manually draw the four frames, but after that you can run the script. Remember to change the minimum height it checks for -- the script only checks text frames, but you might have a callout box or figure caption or something like that on some pages.

                           

                          You can't use the 'columns inside a frame' option (in Text Frame Options) because then InDesign will always have the text run from the left column to the right one. Four separate frames, and that should be it. Nothing additional needed for a gutter.

                          • 11. Re: JS script to continue parallel column layout to new pages
                            ScratchyBoy Level 1

                            OK, so let me get this straight.  There are 2 columns on the left (even) page, and 2 on the right (odd) page.  Say that column = frame here, but I imagine the leftmost frame can be made to include the gutter between its column and the next (ditto for the others).  So are you saying that when I want to "wrap" down to the next page pair, the cursor has to be in the rightmost frame of the 4-frame spread?  Or can it be in any of them?

                             

                            It is no problem to click the script when I want to flow down, that is easy.  And no, I would never click the script when I am on higher up pages, it will always be at the end of the text.  So, for example, I wouldn't click it until I was approaching the bottom of page 2 (or 3), just tell me which column (frame) I have to be in to get it to flow correctly.  As long as I know, then "no", I don't need a continuously running script.

                             

                            Also, I am not sure exactly what lines to change with your edited liines above.

                            • 12. Re: JS script to continue parallel column layout to new pages
                              ScratchyBoy Level 1

                              Oops, I didn't see that last post, it has largely answered what I asked, except for which frame of the 4 to be in, and how

                              to fix the script


                              • 13. Re: JS script to continue parallel column layout to new pages
                                jay fresno Level 1

                                Not sure if it is an option for you to switch from InDesign to FrameMaker, but continuing a parallel column layout to new pages is quite simple using Adobe FrameMaker -- no scripting involved. FrameMaker solves the problem by letting you assign different "Text Flow" labels to the left and right pages -- you can even have more than one flow on the same page. For example, I used this technique to create a book with German language on the left-hand pages and English language on the right-hand pages. It was super easy with FrameMaker to keep the German and English flows separate.

                                • 14. Re: JS script to continue parallel column layout to new pages
                                  ScratchyBoy Level 1

                                  Jay, this is why I am asking on this forum -- I have not picked anything in particular yet -- so yes, I could use framemaker, if it is still available.

                                  Remember, it is 2 columns on the left even pages and 2 on the right -- and they all have different texts.  If I set up 4 vertical frames, will they all stay in their correct relative positions throughout the book (i.e. left 2 on left pages, right 2 on right pages)?

                                  • 15. Re: JS script to continue parallel column layout to new pages
                                    [Jongware] Most Valuable Participant

                                    As it happens, it doesn't really matter in which frame your cursor is. The new pages are added, and all four frames are linked to the ones on the previous spread.

                                     

                                    The four lines to change in are this section at the very bottom:

                                     

                                    // Add a page for frames 0,1
                                    p = app.documents[0].pages.add();
                                    // Add and link frames
                                    bounds = allFrames[0].geometricBounds;
                                    nextFrame = p.textFrames.add({geometricBounds:bounds});
                                    allFrames[0].endTextFrame.nextTextFrame = nextFrame;  // This one.
                                     
                                    bounds = allFrames[1].geometricBounds;
                                    nextFrame = p.textFrames.add({geometricBounds:bounds});
                                    allFrames[1].endTextFrame.nextTextFrame = nextFrame;  // And this one.
                                     
                                    // Add a page for frames 2,3
                                    p = app.documents[0].pages.add();
                                    // Add and link frames
                                    bounds = allFrames[2].geometricBounds;
                                    nextFrame = p.textFrames.add({geometricBounds:bounds});
                                    allFrames[2].endTextFrame.nextTextFrame = nextFrame;  // And also this one.
                                     
                                    bounds = allFrames[3].geometricBounds;
                                    nextFrame = p.textFrames.add({geometricBounds:bounds});
                                    allFrames[3].endTextFrame.nextTextFrame = nextFrame;  // And that makes four.

                                     

                                    With this alteration, the script is much more robust. It'll happily add more and more pages and frames at the end of your document, even if you are on the very first 4-column spread. You can run the script a dozen times and type away, until you need a dozen more pages.

                                    • 16. Re: JS script to continue parallel column layout to new pages
                                      [Jongware] Most Valuable Participant
                                      I imagine the leftmost frame can be made to include the gutter between its column and the next (ditto for the others).

                                       

                                      Erm, no? Having a bit of trouble how you are visualizing this.

                                      Use this to create a new document:

                                       

                                      columns.png

                                       

                                      -- using your own document size and margins, of course. The default number of columns is 1, but you should change it to 2. Fill in a reasonable small value for the gutter, then hit "OK". InDesign will create a set of Master Pages for you, with all necessary guidelines, showing two columns separated by a bit o'gutter on the left hand page, and the same on the right hand page. You don't have to calculate any more allowance for the gutter.

                                       

                                      The guidelines should be magnetic (if not, visit the View menu), making it easy for you to draw your four frames on the first set of pages.

                                      1 person found this helpful
                                      • 17. Re: JS script to continue parallel column layout to new pages
                                        ScratchyBoy Level 1

                                        Thanks IMMENSELY Jongware.  Your help has been outstanding, I wish I could go back and assign your script the "correct" answer.  One final Q, I assume this script will only work in CS4?  There is a hurdle there for SP2 to be installed, which it isn't in my writing system.  No hurdle in CS2.

                                        • 18. Re: JS script to continue parallel column layout to new pages
                                          ScratchyBoy Level 1

                                          Jay --

                                           

                                          Good God man !!  Adobe wants $1000 for Framemaker.  They say it has "improved" support for book publishing.  "Improved" does not always mean better though.  What version framemaker did you use, and do you still have it?  I understand it is not really a DTP, but a frame-based word processor ?  Either way, there is no way I would throw a grand at it, that is for sure.

                                          • 19. Re: JS script to continue parallel column layout to new pages
                                            [Jongware] Most Valuable Participant

                                            Erm, I'm afraid you'll just have to try it and report any negative experiences. In general, the Javascript model has staid pretty much the same, but there have always been smaller and larger improvements, as well as the occasional re-working of an entire class of objects.

                                             

                                            All-in-all it's a fairly basic script -- but, from memory, that handy property endTextFrame may not exist in CS2. Still, nothing to worry about, as there are several scripters with much more pre-CS3 experience than I have, and they'll sure chime in when necessary.

                                            • 20. Re: JS script to continue parallel column layout to new pages
                                              ScratchyBoy Level 1

                                              Nah, I think I will do what I have to to get CS4 in -- everyone says it is much better -- and now with your script, well, that's the biggest plus of all.

                                               

                                              One final thing I forgot to mention, the 2 columns on the left page are different widths -- I presume ID can handle this?  And the texts in each column have different font types and sizes to each other, however, in order to align the texts, I was planning on manually setting the same line height in all 4 columns.  I presume ID can also handle this?

                                              • 21. Re: JS script to continue parallel column layout to new pages
                                                [Jongware] Most Valuable Participant

                                                ID has no problem whatsoever with different column widths and font sizes. The Document Setup thingy will initially create guidelines for equal columns, but of course you are free to ignore them when drawing your own frames. If the predefined guides bother you, create your document with only one column.

                                                 

                                                The script is also not aware of column widths -- it simply copies the sizes of whatever four frames are on your current page (as long as they are high enough to be picked up by the script).

                                                • 22. Re: JS script to continue parallel column layout to new pages
                                                  jay fresno Level 1

                                                  I have FrameMaker version 8 (version 9 is the current version), and have been using it since version 4. I can understand that you woudn't spend $1000 on it -- if you work for a company that would buy it for you, of course, that's different. FrameMaker is a page layout program, but a very specialized one designed for long technical documents, such as user guides. I also use InDesign. I love both of these programs -- two different programs with different target markets.

                                                   

                                                  Sounds like Jongware has created an excellent script that will solve the page flow issue for you, so I agree, might as well use InDesign. Jongware is a treasure -- a talented scripter, likes a challenge and is always ready to help. I am grateful for his help more than once in the past.

                                                  • 23. Re: JS script to continue parallel column layout to new pages
                                                    ScratchyBoy Level 1

                                                    Yep -- that he has.  So it is off into the Indesign world, thanks to Jongware.

                                                    If you guys stay attached, I will post an update in proably 3-4 days.

                                                     

                                                    Thanks again for a super script Jongware, looks like it does all I need.

                                                    • 24. Re: JS script to continue parallel column layout to new pages
                                                      ScratchyBoy Level 1

                                                      Hi Jongware and / or Jay --

                                                       

                                                      Unfortunately, I was not able to install CS4 because of the SP2 issue.  But I have CS2 ID installed.  I am battling a couple of things --

                                                       

                                                      As you showed in your JPG picture, I set up a 2 column layout, but when I try to click on each column to adjust its properties, first I can't find properties for each column (not in right click).  I managed to unlock the layout, and could slide the gutter around, but I can't specify column width exactly.  Struggled with it for hours.  So I dumped the column layout and drew two frames manually.  They look different than columns, I can select one by one, and I can adjust the properties.  But if I do 2 columns in each frame (I know someone said not to do that, because two columns in a frame will wrap left to right, and we don't want any left-right wraping at all) then I have both columns and frames!

                                                       

                                                      Right now I am stumped as to whether I should be creating columns like you showed, or frames.  If columns, I can't right click and individually select or change their properties --  e.g. I need to put in column block margins of 0.05" around each column for the text, and can't do that either.  You will probably say -- read the manual.  I have for hours and it still doesn't help until I get over this hurdle of frames or columns and how to adjust properties.  The Text frame options seem totally independent of the column options -- adding even more confusion as to what I should be using and adjusting !!!

                                                       

                                                      Also need to insert headers and footers, and don't know if they go outside the columns or part inside, or inside or outside frames !!!  In Lotus WordPro, all of the above is done automatically for you, and you simply right click on each page element, and change its properties manually.  It is SO easy!!

                                                       

                                                      If you don't have time to help, maybe Jay might?  Thanks guys.  I am anxious to try out your script on CS2 to see if it works as intended, or if changes need to be made.  So, whether to use frames of columns, and how to adjust properties on each, incl. header and footer, that is the battle I'm having.

                                                      • 25. Re: JS script to continue parallel column layout to new pages
                                                        Harbs. Level 6

                                                        Re. column guides: take a look at:

                                                        "Change page margin and column settings" here: http://help.adobe.com/en_US/InDesign/6.0/WS045460C6-5455-44d9-AB0A-3171FBD01A0F.html

                                                         

                                                        (It's the same in CS2...)

                                                        • 26. Re: JS script to continue parallel column layout to new pages
                                                          ScratchyBoy Level 1

                                                          Thanks Harbs, but I've already got the page margins and # of columns under control.  It is the frame vs. column issue, both with separate settings, that is stumping me -- which to use, how to individually change properties of each.

                                                          • 27. Re: JS script to continue parallel column layout to new pages
                                                            Harbs. Level 6

                                                            The frames should be snapped to the margins. I don't understand your 

                                                            problem.

                                                             

                                                            Harbs

                                                            • 28. Re: JS script to continue parallel column layout to new pages
                                                              ScratchyBoy Level 1

                                                              Jongware will probably have to respond to my long post, 4 above, as it relates to his script and his description of how to make columns, or alternatively frames.

                                                              • 29. Re: JS script to continue parallel column layout to new pages
                                                                [Jongware] Most Valuable Participant

                                                                Well, the script not only assumes separate frames per column, it totally depends on it. You can not use it with InDesign's columns. (Which are not what you need anyway, but let me stress that for clarity.)

                                                                 

                                                                1. Set up your main document. Don't specify any more than 1 column per page -- leave it at "1". Set up the margins as usual (treating both 'columns' you want as a unit).

                                                                2. On your master page, drag a vertical guide out of the left ruler and position it where you want to have the right edge of the left column. The left edge is defined by the regular left margin, so you don't need to do anything for that. Anyway, this is just a guide.

                                                                3. Drag another vertical guide and position it where you want the left of the rightmost column. Now you should have a blank master page, with a purple frame all around, and the cyan lines showing your own handmade 'column gutter'.

                                                                4. Place any repeating headers and footers on the master page as well (page numbering and such. See the manual for this sort of stuff -- it's really basic).

                                                                5. Now add 2 pages to your document so you have your first 2-page spread, on screen and visible, but still without any frames to put your text in. Let's fix that for the first spread.

                                                                6. With the Type tool, drag four separate frames, using the guides as, well, guides. It's easy, if you have "magnetic guides" set to On. Drag the frames as large as you need, but make sure you don't overlap them. Note that you don't have to allow for any "gutter" here; you should simply draw the frames as far apart as you need (you did put your vertical guides at the correct places, didn't you?).

                                                                7. With this first set of four frames, you can begin typing away. Run the script to add another set of two pages and create four new frames that get linked to the existing ones.

                                                                 

                                                                That is, if it works on CS2.

                                                                • 30. Re: JS script to continue parallel column layout to new pages
                                                                  ScratchyBoy Level 1

                                                                  Jongware

                                                                   

                                                                  I did everything you said and I indeed have a 2 page spread of 4 columns with separate texts in them.  ID's terminology is weird, but these are actually "text frames".  Now when I go to Text frame options, the correct width of each text column shows up and I can manually adjust it -- thanks!!

                                                                   

                                                                  I presume the gutter settings on that text frame options dialog is irrelevant for 1 column per frame. Below it, it looks like the inset options is actually the text block options -- the distance to set the text in from the frame border.  If so, I have all I need -- except for the first page -- dragging those guides from the margin presumably just set a snap position for the frames on pages 2 and 3 ?  What more do I do with that page -- set the layout guides fixed?

                                                                   

                                                                  The part I have not done yet is the header and footer.  Every PAGE has a header and a footer, but Adobe in its infinite capacity to obfuscate the simple, only discusses TABLE headers and footers.  Hell, I haven't even got any tables yet, and I don't see why I have to make tables just to get headers and footers on every page!!  So if I have to add a table now, we have 3 divergent things superimosed on one page -- column guides, text frames and tables.

                                                                   

                                                                  Philosophically, I can see that ID has been designed for micromanagement of flyers and brochures, where you want a whole raft of different elements all superimposed on the one page, to put complex layout with shading, table data, photos, and all kinds of mixed jazz all crowded into the one page space.  Of course, this is counter the intent of book design, which is clean, simple, organized, and flows forever.  I see ID will be a real battle to work with.

                                                                   

                                                                  Anyway, after finally figuring out how to install a script, the first error I got was "We got lost somewhere ..." because the cursor was not focussed on a column text.  When I clicked on a column text then ran the script, the error is -- "unable to find the 4 frames .... (0 found)".  So it looks like CS2 will give you a bit of trouble.  If needed, I can always be on the last page before I add any more linked pages.  No problem, as I will be typing there anyway.

                                                                   


                                                                  Thanks again for all your help.

                                                                  • 31. Re: JS script to continue parallel column layout to new pages
                                                                    [Jongware] Most Valuable Participant

                                                                    Yaahhh ... you'd might benefit of one of the Lynda.com's courses at this point. Sure, what Adobe describes for tables are called "headers and footers". That's because that's a special case. Regular, everyday, headers and footers ... you have to draw yourself. That's what the master pages also are for (including such niceties as automatic page numbering and automatically picking up text from your running text to put in the header and/or footer).

                                                                     

                                                                    Anyway, after finally figuring out how to install a script, the first error I got was "We got lost somewhere ..." because the cursor was not focussed on a column text.  When I clicked on a column text then ran the script, the error is -- "unable to find the 4 frames .... (0 found)".  So it looks like CS2 will give you a bit of trouble.

                                                                     

                                                                    Perhaps the script doesn't work at all, but so far it sounds like you didn't adjust the script to look only for frames that match the height of the ones you are using. (Remember, the line where I said to "remember to change this value"?)

                                                                    • 32. Re: JS script to continue parallel column layout to new pages
                                                                      ScratchyBoy Level 1

                                                                      Duuhh !!!  Thanks for the reminder !!  Battling some big problems in ID, I totally forgot about that.

                                                                      • 33. Re: JS script to continue parallel column layout to new pages
                                                                        ScratchyBoy Level 1

                                                                        Jongware --

                                                                         

                                                                        It would appear that your script DOES work in CS2.  Congratulations.  However, I am having trouble undertanding why an inequality relates to an equality

                                                                         

                                                                        if (allFrames[a].geometricBounds[2] - allFrames[a].geometricBounds[0] < 180)
                                                                                  allFrames.splice(a,1);

                                                                         

                                                                        This says that if total height of the frames is LESS THAN 180 mm -- then do the frame splicing.

                                                                         

                                                                        In my case, I used inches.  The page height is 11 inches.  But with 0.5 inch margins top and bottom, the frame height is 10 inches.

                                                                        I tried the value in your equality of 11 inches -- and it should have worked, because 10 inches is less than 11 inches.  But it did not.

                                                                        I tried values less than 10 inches (as well as greater than), and it still did not work.  Only when I used exactly 10 inches did it work.

                                                                         

                                                                        In what kind of multi-dimensional warped-space-time universe does an INequality exactly equal (i.e. equate to) an Equality ??????

                                                                        • 34. Re: JS script to continue parallel column layout to new pages
                                                                          Laubender Adobe Community Professional & MVP

                                                                          @Jongware,

                                                                          recently I tested your script on a document. At first run it behaved a little strange, until I realized that the ruler origin of my document was set to PAGE_ORIGIN. Of course, that will mess up the geometricBounds calculations.
                                                                          So I suggest a few lines of code at the beginning to set the ruler origin to SPREAD_ORIGIN:

                                                                           

                                                                          var d=app.activeDocument;
                                                                          var rulerOriginOLD = d.viewPreferences.rulerOrigin;
                                                                          d.viewPreferences.rulerOrigin = RulerOrigin.SPREAD_ORIGIN;
                                                                          

                                                                           

                                                                          and at the end of the script set them back to what they were:

                                                                           

                                                                          d.viewPreferences.rulerOrigin = rulerOriginOLD;
                                                                          

                                                                           

                                                                          By the way, there is an interesting thread going on about "synoptic typesetting" at the Swiss/German forum "hilfdirselbst". See yourself in its InDesign forum at:
                                                                          http://www.hilfdirselbst.ch/gforum/gforum.cgi?post=438273#438273

                                                                          Gerald Singelmann wrote a script solution, a proof of concept he states, for synchronizing two text flows on paragraph level.

                                                                           

                                                                          Uwe

                                                                          • 35. Re: JS script to continue parallel column layout to new pages
                                                                            [Jongware] Most Valuable Participant

                                                                            Ah, Gerald beat me to it -- I ran a few tests for that as well. It's really easy with only short paragraphs, but with longer ones, as soon as things get out of whack it's very hard to restore ...

                                                                             

                                                                            And then the OP that started your thread wants to insert pictures in either column as well. Good luck with that

                                                                            • 36. Re: JS script to continue parallel column layout to new pages
                                                                              ScratchyBoy Level 1

                                                                              No comment on my question above?  Your code shows an inequality for the line length and I am having trouble seeing why it is an equality.

                                                                              • 37. Re: JS script to continue parallel column layout to new pages
                                                                                [Jongware] Most Valuable Participant

                                                                                I read it but thought, "Boy I hope someone else comes up with an explanation soon".

                                                                                 

                                                                                Only thing I can think of is that InDesign doesn't really work in inches -- nor in millimeters, for that matter. Internally, everything is converted to points.

                                                                                Now usually I would put something like this off to rounding -- because you cannot express a millimeter value exactly in points --, expect that ID uses an exact conversion from inches to points ... (as in: 72 pts per inch -- simple as that.)

                                                                                 

                                                                                And that does not address why (.. < 11) (inch) does not match for a value of "10". That's a contradiction in expectation.

                                                                                 

                                                                                It's possible to set your zero point to halfway the page, but even then the math's hold: top_y is "-5in", bottom_y is "5in", difference is bottom_y minus top_y, so 5 minus -5 which still equals 10, which is (in my experience, up until now) less than 11 ...

                                                                                • 38. Re: JS script to continue parallel column layout to new pages
                                                                                  Harbs. Level 6

                                                                                  I also have no idea why your code would not have worked.

                                                                                   

                                                                                  Maybe post your code and it'll give us a clue?

                                                                                   

                                                                                  Harbs