Skip to content

GroupItems

app.activeDocument.groupItems

The collection of GroupItem objecst in a document.


app.activeDocument.groupItems.length

The number of objects in the collection.

Number; read-only.


app.activeDocument.groupItems.parent

The parent of this object.

Object; read-only.


app.activeDocument.groupItems.typename

The class name of the referenced object.

String; read-only.


app.activeDocument.groupItems.add()

Creates a new object.

GroupItem


app.activeDocument.groupItems.createFromFile(imageFile)

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

ParameterTypeDescription
imageFileFile objectVector art file to place

GroupItem


app.activeDocument.groupItems.getByName(name)

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

ParameterTypeDescription
nameStringName of element to get

GroupItem


app.activeDocument.groupItems.index(itemKey)

Gets an element from the collection.

ParameterTypeDescription
itemKeyString, NumberString or number key

GroupItem


app.activeDocument.groupItems.removeAll()

Deletes all elements in this collection.

Nothing.


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);
}
}