Quantcast
Channel: Adobe Community: Message List - InDesign Scripting
Viewing all articles
Browse latest Browse all 37788

Re: How to find a footnote's number?

$
0
0

Hi,

 

Let assume your stories are not playing with pasteboard (lack of logic shown by Uwe).

So you could create a "footnote map" array to "quite easy" find relative index:

 

var mDocFoot = app.activeDocument.stories.everyItem().footnotes.everyItem().getElements(),          restart = +app.activeDocument.footnoteOptions.restartNumbering,          RelIdx = 0,          FootMap = [],          prevStory = mDocFoot[0].storyOffset.parentStory.index,          prevPage = mDocFoot[0].storyOffset.parentTextFrames[0].parentPage.documentOffset,          prevSpread = mDocFoot[0].storyOffset.parentTextFrames[0].parent.index,          prevSec = mDocFoot[0].storyOffset.parentTextFrames[0].parentPage.appliedSection.index,          currStory, currPage, currSpread, currSec, selIdx, currRelatIdx, k;           for (k = 0; k < mDocFoot.length; k ++){               currStory = mDocFoot[k].storyOffset.parentStory.index;               currPage = mDocFoot[k].storyOffset.parentTextFrames[0].parentPage.documentOffset;               currSpread = mDocFoot[k].storyOffset.parentTextFrames[0].parent.index;               currSec = mDocFoot[k].storyOffset.parentTextFrames[0].parentPage.appliedSection.index;               if (currStory != prevStory)                     {RelIdx = 1; prevStory = currStory; FootMap.push(RelIdx); continue;}               switch (restart) {                    case 1180988019:  RelIdx++; break;                    case 1181774451:                          if (currPage == prevPage) RelIdx++;                          else{RelIdx = 1; prevPage = currPage;}break;                    case 1181971059:                         if (currSpread == prevSpread) RelIdx++;                          else{RelIdx = 1; prevSpread = currSpread;}break;                    case 1181053555:                         if (currSec == prevSec) RelIdx++;                          else{RelIdx = 1; prevSec = currSec;}break;                    }               FootMap.push(RelIdx);          }     selIdx = app.selection[0].footnotes[0].index;     currRelatIdx = FootMap[selIdx];

But restart them regarding on paraStyle? Hm... They still should be listed on a bottom of column? Looks like a kind of "monk job" until you get a key for SDK doors.

Wish you luck, anyway.

 

Jarek


Viewing all articles
Browse latest Browse all 37788

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>