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

get the column of a paragraph in multicolumn textframes

Guest
Jan 14, 2017 Jan 14, 2017

Copy link to clipboard

Copied

Hi, I would like to know how to get the current column of a paragraph in a multicolumn textframe.

Given a story myStory formed by several multicolumn textFrames along multiple pages, I can access to its textFrames, columns of the textFrames, and paragraphs and words and lines,... in that order with codes like

var myParagraph = myStory.paragraphs[a];

var myColumn = myStory.parentTextFrames[myframe].textColumns[myColumnIndex];

 

But I dont know in which sub column is a known paragraph or line. I wonder if exists some method or property to get it as the parent, parentTextFrame or parentStory exist for other objects. In my work I want to know if a paragraph is shared between two or more sub columns.

Thanks in advance.

TOPICS
Scripting

Views

280

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
Mentor ,
Jan 15, 2017 Jan 15, 2017

Copy link to clipboard

Copied

...

In my work I want to know if a paragraph is shared between two or more sub columns.

In this case check givenParagraph.textColumns.length

...

But I dont know in which sub column is a known paragraph or line. I wonder if exists some method or property to get it as the parent, parentTextFrame or parentStory exist for other objects.

...

In this case you may need to calculate it. For example in this way:

(to alert column's number of 1st paragraph of current selection)

var

  arrayOfIndexes = app.selection[0].parentStory.textColumns.everyItem().index,

  searchObject = app.selection[0].paragraphs[0],

  cIndex, step,

  searchIndex = searchObject.textColumns[0].index;

for (step = 0; step < arrayOfIndexes.length; step++) {

  cIndex = arrayOfIndexes[step];

  if (searchIndex == cIndex) {

       alert ("searchObject found in a textColumn number: " + (step+1) );

       break;

       }

  }

Jarek

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
Guest
Jan 20, 2017 Jan 20, 2017

Copy link to clipboard

Copied

LATEST

Thanks very much, Jarek. I´m working with your code.

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