InDesign2026
API 21.5.1.73
Collection of MediaItem

MediaItems

The media items collection.

Properties

NameType AccessDescription
Number readonly The number of objects in the collection.

Methods

→ MediaItem

Returns the MediaItem with the specified index.

index Number The index.
→ MediaItem

Returns any MediaItem in the collection.

→ Number

Displays the number of elements in the MediaItem.

→ MediaItem[]

Returns every MediaItem in the collection.

→ MediaItem

Returns the first MediaItem in the collection.

→ MediaItem

Returns the MediaItem with the specified index or name.

index LongInteger | String The index or name. Can accept: Long Integer or String.
→ MediaItem

Returns the MediaItem with the specified ID.

id Number The ID.
→ MediaItem

Returns the MediaItem with the specified name.

name String The name.
→ MediaItem[]

Returns the MediaItems within the specified range.

from LongInteger | MediaItem | String The MediaItem, index, or name at the beginning of the range. Can accept: MediaItem, Long Integer or String.
to LongInteger | MediaItem | String The MediaItem, index, or name at the end of the range. Can accept: MediaItem, Long Integer or String.
→ MediaItem

Returns the last MediaItem in the collection.

→ MediaItem

Returns the middle MediaItem in the collection.

→ MediaItem

Returns the MediaItem whose index follows the specified MediaItem in the collection.

obj MediaItem The MediaItem whose index comes before the desired MediaItem.
→ MediaItem

Returns the MediaItem with the index previous to the specified index.

obj MediaItem The index of the MediaItem that follows the desired MediaItem.
→ String

Generates a string which, if executed, will return the MediaItem.

Object of 5

Properties elsewhere that hold a MediaItems.