Skip to main content
Inspiring
December 14, 2017
Question

how to find paragraph after the table? Is there is any script available?

  • December 14, 2017
  • 3 replies
  • 2789 views

Regards,

Prakash Chinnasamy

    This topic has been closed for replies.

    3 replies

    Inspiring
    December 25, 2017

    Hi All,

    I got the solution for find the paragraph before and after the table by using table storyOffset value.

    Thanks and Regards,

    Prakash.C

    Community Expert
    December 27, 2017

    Hi Prakash,

    yes. The value of storyOffset of a table is the first insertion point of the special character that constitutes a table.

    Adobe InDesign CS6 (8.0) Object Model JS: Table

    Regards,

    Uwe

    amaarora
    Community Manager
    Community Manager
    December 14, 2017

    Hi,

    Can you explain why you need to find that?

    You can anyway look out for tables using a find/change like...

    -Aman

    Inspiring
    December 15, 2017

    Thanks amaarora,

    I can find table. But i need paragraph after the paragraph. The space should be exist between table and paragraph. I need to give above space for that paragraph.

    Regards,

    Prakash Chinnasamy

    Obi-wan Kenobi
    Legend
    December 15, 2017

    There is no carriage return after the table?

    That does not matter :-)

    The Space After value will be applied:

    But what will matter:
    Is our OP working with table styles where you could add the value once and all tables where the style is applied will follow?

    If not, one has to write a little script to change the spaceAfter property of all tables in the story or in the document.

    But that's easy. For all tables in a story, just put the text cursor in the text and run that little ExtendScript (JavaScript) snippet:

    app.selection[0].parentStory.tables.everyItem().spaceAfter = "5 mm";

    For all tables of all stories* in the document:

    app.documents[0].stories.everyItem().tables.everyItem().spaceAfter = "5 mm";

    ( *tables in footnotes are not affected )

    Regards,
    Uwe


    Uwe,

    I know that but what will probably become problematic [because of the absence of a return-carriage] is if the table is horizontally centered and the text after left-aligned [sample!].

    SpaceAfter or not, you'll have a problem!

    (^/) 

    Mike Witherell
    Community Expert
    Community Expert
    December 14, 2017