0
Community Expert
,
/t5/indesign-discussions/myindex-generate-returns-an-array-not-a-story/td-p/13164693
Aug 28, 2022
Aug 28, 2022
Copy link to clipboard
Copied
My first serious time monkeying around with indexing, and I discovered something curious. The API states that idx.generate() returns a story, but in my code, I'm getting an Array of length 1, where array[0] is the story. Is this just an error in the documentation? Is there ever an instance where that array would be longer than 1?
https://www.indesignjs.de/extendscriptAPI/indesign-latest/#Index_.html#d1e123003__d1e123278
My snippet:
var tempPage = doc.pages.add();
var s = idx.generate(tempPage, undefined, undefined, false, true);
alert(s.length);
s[0].duplicate(LocationOptions.AT_BEGINNING, tf);
tempPage.remove();
TOPICS
Scripting
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
1 Correct answer
Engaged
,
Aug 30, 2022
Aug 30, 2022
Take a look at the ExtendScript Toolkit's object model viewer.
It looks like an array is returned.
Index.generate (on:varies, placePoint:Array of Measurement Unit (Number or String), destinationLayer: Layer , autoflowing: Boolean , includeOverset: Boolean ):Array of Story
Engaged
,
/t5/indesign-discussions/myindex-generate-returns-an-array-not-a-story/m-p/13169146#M490629
Aug 30, 2022
Aug 30, 2022
Copy link to clipboard
Copied
Take a look at the ExtendScript Toolkit's object model viewer.
It looks like an array is returned.
Index.generate (on:varies, placePoint:Array of Measurement Unit (Number or String), destinationLayer: Layer , autoflowing: Boolean , includeOverset: Boolean ):Array of Story
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Community Expert
,
LATEST
/t5/indesign-discussions/myindex-generate-returns-an-array-not-a-story/m-p/13181287#M491438
Sep 06, 2022
Sep 06, 2022
Copy link to clipboard
Copied
(Deleted duplicate reply)
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

