Skip to content

GroupItems

GroupItems

app.activeDocument.groupItems

Description

The collection of GroupItem objecst in a document.


Properties

GroupItems.length

app.activeDocument.groupItems.length

Description

The number of objects in the collection.

Type

Number; read-only.


GroupItems.parent

app.activeDocument.groupItems.parent

Description

The parent of this object.

Type

Object; read-only.


GroupItems.typename

app.activeDocument.groupItems.typename

Description

The class name of the referenced object.

Type

String; read-only.


Methods

GroupItems.add()

app.activeDocument.groupItems.add()

Description

Creates a new object.

Returns

GroupItem


GroupItems.createFromFile()

app.activeDocument.groupItems.createFromFile(imageFile)

Description

Places an external vector art file as a group item in the document.

Parameters

ParameterTypeDescription
imageFileFile objectVector art file to place

Returns

GroupItem


GroupItems.getByName()

app.activeDocument.groupItems.getByName(name)

Description

Gets the first element in the collection with the specified name.

Parameters

ParameterTypeDescription
nameStringName of element to get

Returns

GroupItem


GroupItems.index()

app.activeDocument.groupItems.index(itemKey)

Description

Gets an element from the collection.

Parameters

ParameterTypeDescription
itemKeyString, NumberString or number key

Returns

GroupItem


GroupItems.removeAll()

app.activeDocument.groupItems.removeAll()

Description

Deletes all elements in this collection.

Returns

Nothing.


Example

Importing a PDF as a group item

The following script shows how you can import a PDF document using the GroupItems.createFromFile() function.

// Embeds a new group item in to the current document from a file specified by dest
// dest should contain the full path and file name
function embedPDF(dest) {
var embedDoc = new File(dest);
if (app.documents.length > 0 && embedDoc.exists) {
var doc = app.activeDocument;
var placed = doc.groupItems.createFromFile(embedDoc);
}
}