Table of Contents
Align, Grid & Group
Align and distribute your artwork with more control than Illustrator's own Align panel: exact spacing, whole grids lined up in one go, shapes spread along a path, and groups that remember which layer each shape came from.
See it in the shop · Version 1.0.8 · Needs PowerScripts 3.8.42 or later
Where to find it
Open the PowerScripts panel (Window > Extensions > PowerScripts) and choose Align, Grid & Group from the Tools scripts. The script has four tabs: Grid Align & Distribute, Group, Align and Distribute and Behavior.
Quick start
To space a row of shapes exactly 5 mm apart:
- Select the shapes.
- Open the Align and Distribute tab.
- Next to Horizontal, press the Distribute Horizontal Spacing button (the last one).
- Tick Use fixed spacing and type
5 mm. - Press Align.
Options
Grid Align & Distribute
Use this tab when your shapes are laid out in rows and columns. The script finds the rows and columns for you, then lines them up without mixing up what is in each one.
- Column Align: line up the shapes inside each column, by their left edges, centres or right edges. The first button (four dots) means “leave as it is”.
- Column Distribute: spread the columns across, by left edges, centres, right edges or equal spacing.
- Row Align: line up the shapes inside each row, by their tops, centres or bottoms.
- Row Distribute: spread the rows down, by top edges, centres, bottom edges or equal spacing.
- Use fixed spacing: shows when you pick a distribute button. Instead of spreading the shapes over the space they already take up, the script puts exactly this gap between them.
- Sort by and Reverse order: show with the distribute buttons. Put the shapes in order of Width, Height or Size before spreading them (or None to keep their order on the page), and tick Reverse order to go the other way round.
- Distribute to: spread the grid over the Selection (the space the shapes take up now) or the whole Artboard.
- Treat overlapping shapes as groups: shapes that touch or overlap move together, as one cell of the grid. On by default, so a label on top of a box stays with its box.
- Group Shapes: after lining up, group the shapes in each cell.
- Align & Distribute Grid: does it.
Group
- Group Overlapping Shapes: makes one group of each set of shapes that touch or overlap, and tells you how many groups it made. The list next to it says what to do with groups that are already there:
- Preserve Groups: keep them as they are.
- Remove Items from Existing Groups: take the shapes out of their old groups first.
- Ungroup Existing Groups: ungroup everything first (however deep the groups go), then group again by overlap. Clipping groups stay whole.
- On a big selection, a Stop button shows while it works. Stopping makes no groups.
- Group and remember Layers: groups the selected shapes, and remembers the layer each one was on. This still works after you copy and paste the group into another document.
- Ungroup to Layers: ungroups a group made with Group and remember Layers and puts every shape back on its own layer. A layer that is missing is made again.
Align and Distribute
Everything Illustrator's Align panel does, plus a few things it can't.
- Horizontal: align left, centre or right, or distribute by left edges, centres, right edges or equal spacing. The first button means “no change across”.
- Vertical: align top, centre or bottom, or distribute by top edges, centres, bottom edges or equal spacing. The first button means “no change down”.
- Use fixed spacing: put an exact gap between the shapes (see the Quick start). You don't need to pick a key object. With Relative to: Artboard, the spaced shapes are centred on the artboard.
- Sort by and Reverse order: spread the shapes in order of width, height or size, or the other way round.
- Relative to: line up with the Selection, the Artboard, or a Path.
- With Path, select the path in your document and press Select Path. The script remembers it and shows “1 items selected”.
- Align to path: turn each shape so it follows the direction of the path, the first and last ones included.
- Align: does it.
Behavior
- Instantly align when option button pressed: no need to press Align or Align & Distribute Grid. Pressing an align or distribute button runs it straight away, on the tab you're on.
- Use visible size (including strokes): measure shapes by what you see, including the stroke width, instead of the path itself. Tick this when your shapes have thick strokes.
How to...
Line up a messy grid of products
- Select every shape in the grid.
- On Grid Align & Distribute, pick Column Align: centre and Row Align: centre.
- Pick Column Distribute: equal spacing and Row Distribute: equal spacing. Tick Use fixed spacing if you want an exact gap.
- Leave Treat overlapping shapes as groups ticked so product names stay with their products.
- Press Align & Distribute Grid.
Spread shapes along a curve
- On Align and Distribute, set Relative to to Path (the third button).
- Select the path in your document and press Select Path.
- Tick Align to path if the shapes should turn with the curve.
- Select the shapes you want on the path.
- Pick a Horizontal distribute button and press Align.
Move artwork between documents and keep its layers
- Select the artwork and press Group and remember Layers on the Group tab.
- Copy and paste the group into the other document.
- Select it there and press Ungroup to Layers. Each shape goes back to a layer with its old name.
Tips
- Tick Instantly align when option button pressed on the Behavior tab and the script works like a quick toolbar: one click per change.
- Save the settings you use most as a preset (see Using Presets), for example “5 mm gaps”.
- Run the script from a key on your keyboard with Hotkeys and Quick Keys.
- Undo (Ctrl+Z / Cmd+Z) puts everything back if the result isn't what you wanted.
- Grids work best when the rows and columns are roughly lined up already. If one tall shape or a long caption spans two rows, the script may see the two rows as one: line that shape up by hand first, or leave it out of the selection.
Good to know
- On Ungroup to Layers, a shape that was on a sublayer goes onto a top-level layer with that sublayer's name.
- Grouping a very big selection by overlap can take a while: use Stop if you change your mind.
What's new
- 1.0.8
- New: Group Overlapping Shapes can be stopped on a big selection.
- New: with “Instantly align when option button pressed” ticked, an align or distribute button aligns straight away.
- Fixed: Group and remember Layers no longer stops with an error when a shape on a sublayer sits outside the artboards.
- Fixed: Reverse order, distributing to the artboard with a fixed spacing, and ungrouping deeply nested groups now work.
- Improved: general bug fixes, reliability and speed.
- 1.0.6: Buy in PowerScripts now opens this script's page in the shop.
- 1.0.5: Updated for PowerScripts 3.8.32.
- Older changes: PowerScripts Release Notes


