GroupItem
GroupItem
Section titled “GroupItem”app.activeDocument.groupItems[index]
Description
Section titled “Description”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.
Properties
Section titled “Properties”GroupItem.artworkKnockout
Section titled “GroupItem.artworkKnockout”app.activeDocument.groupItems[index].artworkKnockout
Description
Section titled “Description”Is this object used to create a knockout, and if so, what kind of knockout.
GroupItem.blendingMode
Section titled “GroupItem.blendingMode”app.activeDocument.groupItems[index].blendingMode
Description
Section titled “Description”The blend mode used when compositing an object.
GroupItem.clipped
Section titled “GroupItem.clipped”app.activeDocument.groupItems[index].clipped
Description
Section titled “Description”If true, the group is clipped to the clipping mask.
Boolean.
GroupItem.compoundPathItems
Section titled “GroupItem.compoundPathItems”app.activeDocument.groupItems[index].compoundPathItems
Description
Section titled “Description”The compound path items contained in this group.
CompoundPathItems; read-only.
GroupItem.controlBounds
Section titled “GroupItem.controlBounds”app.activeDocument.groupItems[index].controlBounds
Description
Section titled “Description”The bounds of the object including stroke width and controls.
Array of 4 numbers; read-only.
GroupItem.editable
Section titled “GroupItem.editable”app.activeDocument.groupItems[index].editable
Description
Section titled “Description”If true, this item is editable.
Boolean; read-only.
GroupItem.geometricBounds
Section titled “GroupItem.geometricBounds”app.activeDocument.groupItems[index].geometricBounds
Description
Section titled “Description”The bounds of the object excluding stroke width.
Array of 4 numbers; read-only.
GroupItem.graphItems
Section titled “GroupItem.graphItems”app.activeDocument.groupItems[index].graphItems
Description
Section titled “Description”he graph items contained in this group.
GraphItems; read-only.
GroupItem.groupItems
Section titled “GroupItem.groupItems”app.activeDocument.groupItems[index].groupItems
Description
Section titled “Description”The group items contained in this group.
GroupItems; read-only.
GroupItem.height
Section titled “GroupItem.height”app.activeDocument.groupItems[index].height
Description
Section titled “Description”The height of the group item.
Number (double).
GroupItem.hidden
Section titled “GroupItem.hidden”app.activeDocument.groupItems[index].hidden
Description
Section titled “Description”If true, this group item is hidden.
Boolean.
GroupItem.isIsolated
Section titled “GroupItem.isIsolated”app.activeDocument.groupItems[index].isIsolated
Description
Section titled “Description”If true, this object is isolated.
Boolean.
GroupItem.layer
Section titled “GroupItem.layer”app.activeDocument.groupItems[index].layer
Description
Section titled “Description”The layer to which this group item belongs.
Layer; read-only.
GroupItem.left
Section titled “GroupItem.left”app.activeDocument.groupItems[index].left
Description
Section titled “Description”The position of the left side of the item (in points, measured from the left side of the page).
Number (double).
GroupItem.legacyTextItems
Section titled “GroupItem.legacyTextItems”app.activeDocument.groupItems[index].legacyTextItems
Description
Section titled “Description”The legacy text items in the group.
LegacyTextItems; read-only.
GroupItem.locked
Section titled “GroupItem.locked”app.activeDocument.groupItems[index].locked
Description
Section titled “Description”If true, this group item is locked.
Boolean.
GroupItem.meshItems
Section titled “GroupItem.meshItems”app.activeDocument.groupItems[index].meshItems
Description
Section titled “Description”The mesh items contained in this group.
MeshItems; read-only.
GroupItem.name
Section titled “GroupItem.name”app.activeDocument.groupItems[index].name
Description
Section titled “Description”The name of this group item.
String.
GroupItem.nonNativeItems
Section titled “GroupItem.nonNativeItems”app.activeDocument.groupItems[index].nonNativeItems
Description
Section titled “Description”The non-native art items in this group.
GroupItem.note
Section titled “GroupItem.note”app.activeDocument.groupItems[index].note
Description
Section titled “Description”The note assigned to this item.
String.
GroupItem.opacity
Section titled “GroupItem.opacity”app.activeDocument.groupItems[index].opacity
Description
Section titled “Description”The opacity of the object.
Range: 0.0 to 100.0.
Number (double).
GroupItem.pageItems
Section titled “GroupItem.pageItems”app.activeDocument.groupItems[index].pageItems
Description
Section titled “Description”The page items (all art item classes) contained in this group.
PageItems; read-only.
GroupItem.parent
Section titled “GroupItem.parent”app.activeDocument.groupItems[index].parent
Description
Section titled “Description”The parent of this object.
Layer or GroupItem; read-only.
GroupItem.pathItems
Section titled “GroupItem.pathItems”app.activeDocument.groupItems[index].pathItems
Description
Section titled “Description”The path items contained in this group.
PathItems; read-only.
GroupItem.placedItems
Section titled “GroupItem.placedItems”app.activeDocument.groupItems[index].placedItems
Description
Section titled “Description”The placed items contained in this group.
PlacedItems; read-only.
GroupItem.pluginItems
Section titled “GroupItem.pluginItems”app.activeDocument.groupItems[index].pluginItems
Description
Section titled “Description”The plug-in items contained in this group.
PluginItems; read-only.
GroupItem.position
Section titled “GroupItem.position”app.activeDocument.groupItems[index].position
Description
Section titled “Description”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.
GroupItem.rasterItems
Section titled “GroupItem.rasterItems”app.activeDocument.groupItems[index].rasterItems
Description
Section titled “Description”The raster items contained in this group.
RasterItems; read-only.
GroupItem.selected
Section titled “GroupItem.selected”app.activeDocument.groupItems[index].selected
Description
Section titled “Description”If true, this group item is selected.
Boolean.
GroupItem.sliced
Section titled “GroupItem.sliced”app.activeDocument.groupItems[index].sliced
Description
Section titled “Description”If true, the item sliced.
Default: false.
Boolean.
GroupItem.symbolItems
Section titled “GroupItem.symbolItems”app.activeDocument.groupItems[index].symbolItems
Description
Section titled “Description”The symbol item objects in this group.
SymbolItems; read-only.
GroupItem.tags
Section titled “GroupItem.tags”app.activeDocument.groupItems[index].tags
Description
Section titled “Description”The tags contained in this group.
Tags; read-only.
GroupItem.textFrames
Section titled “GroupItem.textFrames”app.activeDocument.groupItems[index].textFrames
Description
Section titled “Description”The text art items contained in this group.
TextFrameItems; read-only.
GroupItem.top
Section titled “GroupItem.top”app.activeDocument.groupItems[index].top
Description
Section titled “Description”The position of the top of the item (in points, measured from the bottom of the page).
Number (double).
GroupItem.typename
Section titled “GroupItem.typename”app.activeDocument.groupItems[index].typename
Description
Section titled “Description”The class name of the referenced object.
String; read-only.
GroupItem.uRL
Section titled “GroupItem.uRL”app.activeDocument.groupItems[index].uRL
Description
Section titled “Description”The value of the Adobe URL tag assigned to this group item.
String.
GroupItem.visibilityVariable
Section titled “GroupItem.visibilityVariable”app.activeDocument.groupItems[index].visibilityVariable
Description
Section titled “Description”The visibility variable bound to the item.
GroupItem.visibleBounds
Section titled “GroupItem.visibleBounds”app.activeDocument.groupItems[index].visibleBounds
Description
Section titled “Description”The visible bounds of the group item including stroke width.
Array of 4 numbers; read-only.
GroupItem.width
Section titled “GroupItem.width”app.activeDocument.groupItems[index].width
Description
Section titled “Description”The width of the group item.
Number (double).
GroupItem.wrapInside
Section titled “GroupItem.wrapInside”app.activeDocument.groupItems[index].wrapInside
Description
Section titled “Description”If true, the text frame object should be wrapped inside this object.
Boolean.
GroupItem.wrapOffset
Section titled “GroupItem.wrapOffset”app.activeDocument.groupItems[index].wrapOffset
Description
Section titled “Description”The offset to use when wrapping text around this object.
Number (double).
GroupItem.wrapped
Section titled “GroupItem.wrapped”app.activeDocument.groupItems[index].wrapped
Description
Section titled “Description”If true, wrap text frame objects around this object (text frame must be above the object).
Boolean.
GroupItem.zOrderPosition
Section titled “GroupItem.zOrderPosition”app.activeDocument.groupItems[index].zOrderPosition
Description
Section titled “Description”The position of this group object within the stacking order of the group or layer (parent) that contains the group object.
Number (long).
Methods
Section titled “Methods”GroupItem.duplicate()
Section titled “GroupItem.duplicate()”app.activeDocument.groupItems[index].duplicate( [relativeObject] [,insertionLocation])Description
Section titled “Description”Creates a duplicate of the selected object.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
relativeObject | Object, optional | Object to duplicate to |
insertionLocation | ElementPlacement, optional | Location to insert element |
Returns
Section titled “Returns”GroupItem.move()
Section titled “GroupItem.move()”app.activeDocument.groupItems[index].move(relativeObject, insertionLocation)
Description
Section titled “Description”Moves the object.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
relativeObject | Object | Object to move element within |
insertionLocation | ElementPlacement, optional | Location to move element to |
Returns
Section titled “Returns”GroupItem.remove()
Section titled “GroupItem.remove()”app.activeDocument.groupItems[index].remove()
Description
Section titled “Description”Deletes this object.
Returns
Section titled “Returns”Nothing.
GroupItem.resize()
Section titled “GroupItem.resize()”app.activeDocument.groupItems[index].resize( scaleX, scaleY [,changePositions] [,changeFillPatterns] [,changeFillGradients] [,changeStrokePattern] [,changeLineWidths] [,scaleAbout])Description
Section titled “Description”Scales the art item where scaleX is the horizontal scaling factor and scaleY is the vertical scaling factor. 100.0 = 100%.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
scaleX | Number (double) | Horizontal scaling factor |
scaleY | Number (double) | Vertical scaling factor |
changePositions | Boolean, optional | Whether to effect art object positions and orientations |
changeFillPatterns | Boolean, optional | Whether to transform fill patterns |
changeFillGradients | Boolean, optional | Whether to transform fill gradients |
changeStrokePattern | Boolean, optional | Whether to transform stroke patterns |
changeLineWidths | Number (double), optional | The amount to scale line widths |
scaleAbout | Transformation, optional | The point to use as anchor, to transform about |
Returns
Section titled “Returns”Nothing.
GroupItem.rotate()
Section titled “GroupItem.rotate()”app.activeDocument.groupItems[index].rotate( angle [,changePositions] [,changeFillPatterns] [,changeFillGradients] [,changeStrokePattern] [,rotateAbout])Description
Section titled “Description”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.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
angle | Number (double) | The angle amount to rotate the element |
changePositions | Boolean, optional | Whether to effect art object positions and orientations |
changeFillPatterns | Boolean, optional | Whether to transform fill patterns |
changeFillGradients | Boolean, optional | Whether to transform fill gradients |
changeStrokePattern | Boolean, optional | Whether to transform stroke patterns |
rotateAbout | Transformation, optional | The point to use as anchor, to transform about |
Returns
Section titled “Returns”Nothing.
GroupItem.transform()
Section titled “GroupItem.transform()”app.activeDocument.groupItems[index].transform( transformationMatrix [,changePositions] [,changeFillPatterns] [,changeFillGradients] [,changeStrokePattern] [,changeLineWidths] [,transformAbout])Description
Section titled “Description”Transforms the art item by applying a transformation matrix.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
transformationMatrix | Matrix | Transformation matrix to apply |
changePositions | Boolean, optional | Whether to change Positions |
changeFillPatterns | Boolean, optional | Whether to change Fill Patterns |
changeFillGradients | Boolean, optional | Whether to change Fill Gradients |
changeStrokePattern | Boolean, optional | Whether to change Stroke Pattern |
changeLineWidths | Number (double), optional | The amount to scale line widths |
transformAbout | Transformation, optional | The point to use as anchor, to transform about |
Returns
Section titled “Returns”Nothing.
GroupItem.translate()
Section titled “GroupItem.translate()”app.activeDocument.groupItems[index].translate( [deltaX] [,deltaY] [,transformObjects] [,transformFillPatterns] [,transformFillGradients] [,transformStrokePatterns])Description
Section titled “Description”Repositions the art item relative to the current position, where deltaX is the horizontal offset and deltaY is the vertical offset.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
deltaX | Number (double), optional | Horizontal offset |
deltaY | Number (double), optional | Vertical offset |
transformObjects | Boolean, optional | Whether to transform Objects |
transformFillPatterns | Boolean, optional | Whether to transform Fill Patterns |
transformFillGradients | Boolean, optional | Whether to transform Fill Gradients |
transformStrokePatterns | Boolean, optional | Whether to transform Stroke Patterns |
Returns
Section titled “Returns”Nothing.
GroupItem.zOrder()
Section titled “GroupItem.zOrder()”app.activeDocument.groupItems[index].zOrder(zOrderCmd)
Description
Section titled “Description”Arranges the art item’s position in the stacking order of the group or layer (parent) of this object.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
zOrderCmd | ZOrderMethod | Stacking order arrangement method |
Returns
Section titled “Returns”Nothing.
Example
Section titled “Example”Modifying all objects in a group
Section titled “Modifying all objects in a group”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;}