Group by Attributes
Script for Adobe Illustrator
ㅤ
Functionality
Group by Attributes is a powerful automation tool for Adobe Illustrator that helps you organize your artwork by intelligently grouping objects that share common visual properties. Whether you're working with complex illustrations, preparing files for production, or simply trying to organize a messy artboard, this script streamlines the process by automatically detecting and grouping objects with matching attributes.
ㅤ
Key Features
- Multiple Attribute Options: Group objects by fill color, stroke color, stroke weight, opacity, or blending mode
- Flexible Combinations: Select any combination of attributes to create precise grouping criteria
- Live Preview Mode: Visualize grouping results in real-time with color-coded dashed bounding boxes before applying
- Subgroup Creation: Create nested subgroups within existing groups based on matching attributes
- Smart Naming: Automatically names groups based on their shared attributes for easy identification
- Zoom to Selection: Quickly fit your selection in the window for better preview visibility
- Z-Order Preservation: Maintains the original stacking order of objects within groups
ㅤ
Use Cases
- Organize complex illustrations with multiple color variations
- Prepare artwork for production by grouping objects with the same print attributes
- Clean up messy artboards by consolidating similar objects
- Create structured layer hierarchies for easier editing
- Batch organize objects within existing groups
ㅤ
Installation
1. Download the Group by Attributes.jsx script file.
2. Place the script in your Adobe Illustrator Scripts folder:
⮑ Mac: /Applications/Adobe Illustrator <Version>/Presets/<Language>/Scripts
⮑ Windows: C:\Program Files\Adobe\Adobe Illustrator <Version>\Presets\<Language>\Scripts
3. Restart Adobe Illustrator if it's already running.
4. Access the script via File > Scripts > Group by Attributes
ㅤ
Using the Script
ㅤ
Prepare Your Document
- Open an Adobe Illustrator document with objects you want to group
- Ensure you have at least two objects in your document
ㅤ
Select Objects
- Select at least two objects that you want to group by their attributes
- You can select individual objects, existing groups, or a mix of both
- Use the Selection Tool (V) to select multiple objects
ㅤ
Run the Script
- Go to File > Scripts > Group by Attributes
- The script dialog will appear:
ㅤ

ㅤ
Choose Grouping Attributes
Select one or more attributes to use as grouping criteria:
ㅤ
Object Attributes:
- Fill Color: Groups objects with the same fill color (enabled by default)
- Stroke Color: Groups objects with the same stroke color
- Stroke Weight: Groups objects with the same stroke width
- Opacity: Groups objects with the same opacity level
- Blending Mode: Groups objects with the same blending mode (Normal, Multiply, Screen, etc.)
ㅤ
Text Frame Attributes:
- Font Family: Groups text frames that use the same font family
- Text Size: Groups text frames with the same text size
ㅤ
Note: You must select at least one attribute for the script to work.
ㅤ
Configure Subgrouping (Optional)
If you have existing groups selected, you'll see an additional option:
- Create subgroups within existing groups:
- When enabled, the script creates nested subgroups inside selected groups based on matching attributes.
- When disabled, no subgrouping is performed on existing groups.
ㅤ
Enable Preview (Optional)
Use the Preview feature to visualize grouping results before applying:
- Preview Checkbox: Enable to see real-time preview of how objects will be grouped
- When enabled, selection bounding boxes are hidden for clearer visualization
- Color-coded dashed rectangles show which objects will be grouped together
- Each potential group is highlighted with a different color (Red, Green, Blue, Orange, etc.)
- Preview updates automatically when you change attribute selections
ㅤ
- Zoom Button (✚): Click to fit the selection in the window for better visibility
- Only available when Preview is enabled
- Helps you see the entire selection and preview rectangles at once
ㅤ
Advanced Usage
Grouping by Multiple Attributes
For more precise grouping, combine multiple attributes:
ㅤ
Example 1: Group by Fill Color + Stroke Weight
- Select: Fill Color ✓, Stroke Weight ✓
- Result: Objects must have both the same fill color AND stroke weight to be grouped together
ㅤ
Example 2: Group by Fill Color + Stroke Color + Opacity
- Select: Fill Color ✓, Stroke Color ✓, Opacity ✓
- Result: Objects must match all three attributes to be grouped
ㅤ
Example 3: Group Text Frames by Font + Size
- Select: Font Family ✓, Text Size ✓
- Result: Text frames must have both the same font family AND text size to be grouped together
ㅤㅤ
Working with Text Frames
The script can group text frames based on typography attributes:
ㅤ
Scenario 1: Organize Text by Font Family
- Select multiple text frames with different fonts
- Run the script
- Enable "Font Family"
- All text frames using the same font will be grouped together
ㅤ
Scenario 2: Group Text by Size
- Select text frames with various sizes
- Run the script
- Enable "Text Size"
- Text frames with matching point sizes will be grouped
ㅤ
Scenario 3: Combine Font and Size
- Select text frames
- Enable both "Font Family" and "Text Size"
- Only text frames with both matching font AND size will be grouped
ㅤ
Understanding Group Names
The script automatically generates descriptive names for created groups:
- Color-based names: Red_Fill, Blue_Stroke, CMYK_Fill, Gray_Stroke
- Stroke weight: 2pt, 5pt, NoStrokeWeight
- Opacity: 50%_Opacity, 75%_Opacity
- Blending modes: Normal, Multiply, Screen, Overlay, etc.
- Text attributes: Arial_12pt, Helvetica_Neue_18pt
- Combined attributes: Red_Fill_2pt_Normal (fill + weight + blend mode)
ㅤ
Tips and Best Practices
- Use Preview Mode: Enable Preview to visualize grouping before applying - it helps avoid mistakes
- Start Simple: Begin with just Fill Color to understand how the script works
- Zoom for Clarity: Use the Zoom button (✚) when Preview is enabled to see all groups at once
- Undo Available: Use Cmd/Ctrl+Z if you need to undo the grouping
- Nested Organization: Use subgrouping to create hierarchical organization without flattening your existing group structure
- Color Matching: The script matches colors precisely - slight variations will create separate groups
- Preview Performance: Preview works best with selections under 500 objects for smooth real-time updates
- Experiment Safely: Toggle different attributes with Preview enabled to find the best grouping strategy
ㅤ
Conclusion
Group by Attributes streamlines your Illustrator workflow by automating the tedious task of organizing objects based on their visual properties.
With its intuitive preview mode and flexible attribute combinations, you can quickly transform chaotic artworks into well-structured, easily manageable compositions.
Start with the basics, experiment with different attribute combinations, and let the script handle the heavy lifting of organization.
ㅤㅤ