GroupItems
GroupItems
Section titled “GroupItems”app.activeDocument.groupItems
Description
Section titled “Description”The collection of GroupItem objecst in a document.
Properties
Section titled “Properties”GroupItems.length
Section titled “GroupItems.length”app.activeDocument.groupItems.length
Description
Section titled “Description”The number of objects in the collection.
Number; read-only.
GroupItems.parent
Section titled “GroupItems.parent”app.activeDocument.groupItems.parent
Description
Section titled “Description”The parent of this object.
Object; read-only.
GroupItems.typename
Section titled “GroupItems.typename”app.activeDocument.groupItems.typename
Description
Section titled “Description”The class name of the referenced object.
String; read-only.
Methods
Section titled “Methods”GroupItems.add()
Section titled “GroupItems.add()”app.activeDocument.groupItems.add()
Description
Section titled “Description”Creates a new object.
Returns
Section titled “Returns”GroupItems.createFromFile()
Section titled “GroupItems.createFromFile()”app.activeDocument.groupItems.createFromFile(imageFile)
Description
Section titled “Description”Places an external vector art file as a group item in the document.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
imageFile | File object | Vector art file to place |
Returns
Section titled “Returns”GroupItems.getByName()
Section titled “GroupItems.getByName()”app.activeDocument.groupItems.getByName(name)
Description
Section titled “Description”Gets the first element in the collection with the specified name.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
name | String | Name of element to get |
Returns
Section titled “Returns”GroupItems.index()
Section titled “GroupItems.index()”app.activeDocument.groupItems.index(itemKey)
Description
Section titled “Description”Gets an element from the collection.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
itemKey | String, Number | String or number key |
Returns
Section titled “Returns”GroupItems.removeAll()
Section titled “GroupItems.removeAll()”app.activeDocument.groupItems.removeAll()
Description
Section titled “Description”Deletes all elements in this collection.
Returns
Section titled “Returns”Nothing.
Example
Section titled “Example”Importing a PDF as a group item
Section titled “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); }}