0 Replies Latest reply on May 20, 2017 10:43 AM by david7284

    space before for all paragraphs in text frame

    david7284

      Hi,

       

      I'm new to ID scripting.  My doc has many pages and each page has many text frames. The text frames I'm interested in have another text frame with a table that I've marked with a label. 

       

      The relevant text frames have:

       

      Paragraph (space before is set to .125)

      text frame with table

      Paragraph (space before is set to .3125)

      Paragraph (space before is set to .125)

       

      I successfully find all my tables with var xTables = myDoc.stories.everyItem().tables.everyItem().getElements();  I loop through the tables and in most cases dynamically change column sizes, fills, etc based on certain conditions.  That's all working fine.

       

      In a few cases, I want to (1) set the space before of all the paragraphs in the text frame to .125 and (2) delete the table and it's parent text frame.  Since 2 of the 3 paragraphs already have a space before of .125, another way of saying it is I want to change the space before to .125 for the paragraph following the table.

       

      I can do #2 with: xTables[t].parent.remove()

      Can anyone help with what I need to do to set all (or next) paragraph(s) in that text frame to .125? 

      Something like: xTables[t].parent.parent.paragraphs.spaceBefore = .125; with a final result of:

       

      The updated relevant text frames have:

       

      Paragraph (space before is set to .125)

      Paragraph (space before is set to .125)

      Paragraph (space before is set to .125)

       

      Thank you!