Created
August 5, 2012 09:27
-
-
Save moluapple/3263337 to your computer and use it in GitHub Desktop.
[Indesign] get a paragraph's index within it's parent textframe
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (!Array.prototype.indexOf) { | |
Array.prototype.indexOf = function (item, i) { | |
i || (i = 0); | |
var length = this.length; | |
if (i < 0) i = length + i; | |
for (; i < length; i++) | |
if (this[i] === item) return i; | |
return -1; | |
} | |
} | |
var p = app.selection[0], | |
inxs = p.parentTextFrames[0].paragraphs.everyItem().index, | |
inx = p.index; | |
alert(inxs.indexOf(inx) + 1); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment