• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

add enter after inline table

Participant ,
Jul 30, 2019 Jul 30, 2019

Copy link to clipboard

Copied

I needs to add enter mark after all inline tables via script. Please advice.

Capture.PNG

TOPICS
Scripting

Views

784

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jul 30, 2019 Jul 30, 2019

Hi priyak7746321 ,

check the value of storyOffset of a table in its story object:

Adobe InDesign CS6 (8.0) Object Model JS: Table

Example with the first table of the first story of the active document:

app.documents[0].stories[0].insertionPoints

[

    app.documents[0].stories[0].tables[0].storyOffset.index+1

].contents = "\r";

What I'm doing here?

I tell the first insertion point after the table to get new contents.

A paragraph character.

storyOffset of a table is the insertion point before the table.

story

...

Votes

Translate

Translate
Community Expert ,
Jul 30, 2019 Jul 30, 2019

Copy link to clipboard

Copied

Hi priyak7746321 ,

check the value of storyOffset of a table in its story object:

Adobe InDesign CS6 (8.0) Object Model JS: Table

Example with the first table of the first story of the active document:

app.documents[0].stories[0].insertionPoints

[

    app.documents[0].stories[0].tables[0].storyOffset.index+1

].contents = "\r";

What I'm doing here?

I tell the first insertion point after the table to get new contents.

A paragraph character.

storyOffset of a table is the insertion point before the table.

storyOffset.index is the position of that insertion point in its parent story.

storyOffset.index +1 is the position of the next insertion point.

Regards,
Uwe

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Jul 30, 2019 Jul 30, 2019

Copy link to clipboard

Copied

LATEST

As stated by Laubender​,

This how you can achieve this:

var allStory = app.documents[0].stories;

for(var s = 0; s < allStory.length; s++){

    for(var t = 0; t < allStory.tables.length; t++){

        allStory.insertionPoints[allStory.tables.storyOffset.index+1].contents = "\r";

        }

    }

Best

Sunil

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines