0 Replies Latest reply on Jan 10, 2011 1:37 PM by David Rackham

    Script to adjust XML data layout (Looking for resources)

    David Rackham

      My purpose in posting is to see if anyone can point me to some resources that will help answer some questions that I have.  I'm fairly new to InDesign and have done some *basic* scripting before but not enough to know what exactly I should be asking.

       

      What I have going on is a lot of content that is very dynamic.  The layout of the content is probably exactly the same 85% of the time, but I am looking for a way to automatically adjust the layout for the exceptions.  Basically it will be a document that has a table of data (text) that will vary in the number of rows and columns.  My main concern is dealing with the change in the number of rows.

       

      So for instance if for one occurence of the data I have 4 columns then I want it to dynamically adjust the properities of the table, but if the next occurence has say 6 columns I want the formatting to respond.  The data is currently in an XML file.  I am aware that I will have to create a copy of the template for each occurence (case?) of the data.  Each case will be on a separate page.  My main question is this.  Can I import the XML and then run some type of script that will alter the layout (number of columns etc.)on specific pages?  I.e. if one page has 6 columns the script detects that and makes the necessary adjustments, while the page the has 4 columns is able to respond accordingly.  Currently I have everything set up as individual text boxes that are tagged, but I could create a table layout as well.

       

      Could someone point me in the right direction?  I've done a fair amount of C++ program before so I'm not too worried about having to make a custom script if I need to, I just need to be pointed in the right direction.

       

      Thanks!