Indesign scripting - negative object reference



Quick reminder:

When scripting Indesign a negative object reference means the "last" of something.

eg
myTextFrame.insertionPoints.item(-1).place(myTextFile); // the end of a text frame

or from the Scripting guide:

Note that you can use negative numbers to refer to the layers in the layers collection of a document. Layer  -1 refers to the last (bottom) layer in the collection.

eg layer(-1);

Beware of dynamic collections of objects. Messing with them will change references to items:

http://cssdk.host.adobe.com/sdk/1.0/docs/WebHelp/app_notes/id_scripting.htm#Dynamic_collections_and_object_types

Comments

Popular posts from this blog