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

myIndex.generate() returns an Array, not a Story?

Community Expert ,
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

Views

73

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

correct answers 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

Votes

Translate

Translate
Engaged ,
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

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
Community Expert ,
Sep 06, 2022 Sep 06, 2022

Copy link to clipboard

Copied

LATEST

(Deleted duplicate reply)

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