Skip to content

GroupItem

app.activeDocument.groupItems[index]

A grouped set of art items. Group items can contain all of the same page items that a layer can contain, including other nested groups.

Paths contained in a group or compound path in a document are returned as individual paths when a script asks for the paths contained in the document. However, paths contained in a group or compound path are not returned when a script asks for the paths in a layer which contains the group or compound path.


app.activeDocument.groupItems[index].artworkKnockout

Is this object used to create a knockout, and if so, what kind of knockout.

KnockoutState


app.activeDocument.groupItems[index].blendingMode

The blend mode used when compositing an object.

BlendModes


app.activeDocument.groupItems[index].clipped

If true, the group is clipped to the clipping mask.

Boolean.


app.activeDocument.groupItems[index].compoundPathItems

The compound path items contained in this group.

CompoundPathItems; read-only.


app.activeDocument.groupItems[index].controlBounds

The bounds of the object including stroke width and controls.

Array of 4 numbers; read-only.


app.activeDocument.groupItems[index].editable

If true, this item is editable.

Boolean; read-only.


app.activeDocument.groupItems[index].geometricBounds

The bounds of the object excluding stroke width.

Array of 4 numbers; read-only.


app.activeDocument.groupItems[index].graphItems

he graph items contained in this group.

GraphItems; read-only.


app.activeDocument.groupItems[index].groupItems

The group items contained in this group.

GroupItems; read-only.


app.activeDocument.groupItems[index].height

The height of the group item.

Number (double).


app.activeDocument.groupItems[index].hidden

If true, this group item is hidden.

Boolean.


app.activeDocument.groupItems[index].isIsolated

If true, this object is isolated.

Boolean.


app.activeDocument.groupItems[index].layer

The layer to which this group item belongs.

Layer; read-only.


app.activeDocument.groupItems[index].left

The position of the left side of the item (in points, measured from the left side of the page).

Number (double).


app.activeDocument.groupItems[index].legacyTextItems

The legacy text items in the group.

LegacyTextItems; read-only.


app.activeDocument.groupItems[index].locked

If true, this group item is locked.

Boolean.


app.activeDocument.groupItems[index].meshItems

The mesh items contained in this group.

MeshItems; read-only.


app.activeDocument.groupItems[index].name

The name of this group item.

String.


app.activeDocument.groupItems[index].nonNativeItems

The non-native art items in this group.

NonNativeItems


app.activeDocument.groupItems[index].note

The note assigned to this item.

String.


app.activeDocument.groupItems[index].opacity

The opacity of the object.

Range: 0.0 to 100.0.

Number (double).


app.activeDocument.groupItems[index].pageItems

The page items (all art item classes) contained in this group.

PageItems; read-only.


app.activeDocument.groupItems[index].parent

The parent of this object.

Layer or GroupItem; read-only.


app.activeDocument.groupItems[index].pathItems

The path items contained in this group.

PathItems; read-only.


app.activeDocument.groupItems[index].placedItems

The placed items contained in this group.

PlacedItems; read-only.


app.activeDocument.groupItems[index].pluginItems

The plug-in items contained in this group.

PluginItems; read-only.


app.activeDocument.groupItems[index].position

The position (in points) of the top left corner of the groupItem object in the format [x, y]. Does not include stroke weight.

Array of 2 numbers.


app.activeDocument.groupItems[index].rasterItems

The raster items contained in this group.

RasterItems; read-only.


app.activeDocument.groupItems[index].selected

If true, this group item is selected.

Boolean.


app.activeDocument.groupItems[index].sliced

If true, the item sliced.

Default: false.

Boolean.


app.activeDocument.groupItems[index].symbolItems

The symbol item objects in this group.

SymbolItems; read-only.


app.activeDocument.groupItems[index].tags

The tags contained in this group.

Tags; read-only.


app.activeDocument.groupItems[index].textFrames

The text art items contained in this group.

TextFrameItems; read-only.


app.activeDocument.groupItems[index].top

The position of the top of the item (in points, measured from the bottom of the page).

Number (double).


app.activeDocument.groupItems[index].typename

The class name of the referenced object.

String; read-only.


app.activeDocument.groupItems[index].uRL

The value of the Adobe URL tag assigned to this group item.

String.


app.activeDocument.groupItems[index].visibilityVariable

The visibility variable bound to the item.

Variable


app.activeDocument.groupItems[index].visibleBounds

The visible bounds of the group item including stroke width.

Array of 4 numbers; read-only.


app.activeDocument.groupItems[index].width

The width of the group item.

Number (double).


app.activeDocument.groupItems[index].wrapInside

If true, the text frame object should be wrapped inside this object.

Boolean.


app.activeDocument.groupItems[index].wrapOffset

The offset to use when wrapping text around this object.

Number (double).


app.activeDocument.groupItems[index].wrapped

If true, wrap text frame objects around this object (text frame must be above the object).

Boolean.


app.activeDocument.groupItems[index].zOrderPosition

The position of this group object within the stacking order of the group or layer (parent) that contains the group object.

Number (long).


app.activeDocument.groupItems[index].duplicate(
[relativeObject]
[,insertionLocation]
)

Creates a duplicate of the selected object.

ParameterTypeDescription
relativeObjectObject, optionalObject to duplicate to
insertionLocationElementPlacement, optionalLocation to insert element

GroupItem


app.activeDocument.groupItems[index].move(relativeObject, insertionLocation)

Moves the object.

ParameterTypeDescription
relativeObjectObjectObject to move element within
insertionLocationElementPlacement, optionalLocation to move element to

GroupItem


app.activeDocument.groupItems[index].remove()

Deletes this object.

Nothing.


app.activeDocument.groupItems[index].resize(
scaleX,
scaleY
[,changePositions]
[,changeFillPatterns]
[,changeFillGradients]
[,changeStrokePattern]
[,changeLineWidths]
[,scaleAbout]
)

Scales the art item where scaleX is the horizontal scaling factor and scaleY is the vertical scaling factor. 100.0 = 100%.

ParameterTypeDescription
scaleXNumber (double)Horizontal scaling factor
scaleYNumber (double)Vertical scaling factor
changePositionsBoolean, optionalWhether to effect art object positions and orientations
changeFillPatternsBoolean, optionalWhether to transform fill patterns
changeFillGradientsBoolean, optionalWhether to transform fill gradients
changeStrokePatternBoolean, optionalWhether to transform stroke patterns
changeLineWidthsNumber (double), optionalThe amount to scale line widths
scaleAboutTransformation, optionalThe point to use as anchor, to transform about

Nothing.


app.activeDocument.groupItems[index].rotate(
angle
[,changePositions]
[,changeFillPatterns]
[,changeFillGradients]
[,changeStrokePattern]
[,rotateAbout]
)

Rotates the art item relative to the current rotation. The object is rotated counter-clockwise if the angle value is positive, clockwise if the value is negative.

ParameterTypeDescription
angleNumber (double)The angle amount to rotate the element
changePositionsBoolean, optionalWhether to effect art object positions and orientations
changeFillPatternsBoolean, optionalWhether to transform fill patterns
changeFillGradientsBoolean, optionalWhether to transform fill gradients
changeStrokePatternBoolean, optionalWhether to transform stroke patterns
rotateAboutTransformation, optionalThe point to use as anchor, to transform about

Nothing.


app.activeDocument.groupItems[index].transform(
transformationMatrix
[,changePositions]
[,changeFillPatterns]
[,changeFillGradients]
[,changeStrokePattern]
[,changeLineWidths]
[,transformAbout]
)

Transforms the art item by applying a transformation matrix.

ParameterTypeDescription
transformationMatrixMatrixTransformation matrix to apply
changePositionsBoolean, optionalWhether to change Positions
changeFillPatternsBoolean, optionalWhether to change Fill Patterns
changeFillGradientsBoolean, optionalWhether to change Fill Gradients
changeStrokePatternBoolean, optionalWhether to change Stroke Pattern
changeLineWidthsNumber (double), optionalThe amount to scale line widths
transformAboutTransformation, optionalThe point to use as anchor, to transform about

Nothing.


app.activeDocument.groupItems[index].translate(
[deltaX]
[,deltaY]
[,transformObjects]
[,transformFillPatterns]
[,transformFillGradients]
[,transformStrokePatterns]
)

Repositions the art item relative to the current position, where deltaX is the horizontal offset and deltaY is the vertical offset.

ParameterTypeDescription
deltaXNumber (double), optionalHorizontal offset
deltaYNumber (double), optionalVertical offset
transformObjectsBoolean, optionalWhether to transform Objects
transformFillPatternsBoolean, optionalWhether to transform Fill Patterns
transformFillGradientsBoolean, optionalWhether to transform Fill Gradients
transformStrokePatternsBoolean, optionalWhether to transform Stroke Patterns

Nothing.


app.activeDocument.groupItems[index].zOrder(zOrderCmd)

Arranges the art item’s position in the stacking order of the group or layer (parent) of this object.

ParameterTypeDescription
zOrderCmdZOrderMethodStacking order arrangement method

Nothing.


It is easy to modify all of the objects contained in a group. This example demonstrates how to simplify your operations on multiple objects by creating group to contain them.

// Creates a new group item, adds a new path item, of triangle shape, to the group,
// then adds a new text item to the group and sets the fill color of the text to red
if (app.documents.length > 0) {
var triangleGroup = app.activeDocument.groupItems.add();
// Create a triangle and add text, the new art is created inside the group
var trianglePath = triangleGroup.pathItems.add();
trianglePath.setEntirePath(Array(Array(100, 100), Array(300, 100), Array(200, Math.tan(1.0471975) * 100 + 100)));
trianglePath.closed = true;
trianglePath.stroked = true;
trianglePath.filled = false;
trianglePath.strokeWidth = 3;
var captionText = triangleGroup.textFrames.add();
captionText.position = Array(100, 150);
captionText.textRange.size = 48;
captionText.contents = "A triangle";
var fillColor = new RGBColor();
fillColor.red = 255;
fillColor.green = 0;
fillColor.blue = 0;
captionText.characters.fillColor = fillColor;
}