Copy link to clipboard
Copied
Hi,
I can get the line number of selected text from document but throwing the error for footnote. How can i get the line number for text from footnote.
Can anyone guide me...
function getLineNumber(myText)
{
try{
var myTF = myText.parentTextFrames[0];
//myTF.select()
line_number = myTF.characters.itemByRange(myTF.characters[0], myText).lines.length;
line_number = line_number-1;
return line_number;
}catch(e){return null;}
}
Thanks in advance,
Sudha K
Copy link to clipboard
Copied
Do you want the number of the line in which the footnote reference occurs, or the number of the line in the footnote?
Copy link to clipboard
Copied
Hi,
Number of the line in the footnote... both will be useful.
Copy link to clipboard
Copied
Number of the line of the footnote reference: get the insertion point of the footnote in the main text:
try{
if (myText.parent instanceof Footnote) {
myText = myText.parent.storyOffset;
}
var myTF = myText.parentTextFrames[0];
. . .
Number of the line in the footnote: you can't use the text frame, clearly, so you need to use the range from the beginning of the note. That is, is the note starts on the same page. If the note starts on an earlier page, you have to make another decision: do you want the number of the line in the note on this particular page or the number from the beginning of the note? Both would be useful, you will say -- so a good task for you to figure out.
Peter
Copy link to clipboard
Copied
Hi,
I want the line number of the footnote contents of the particular page.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now