Two scripts for selecting objects in Adobe Illustrator by size:
-
selectcirclesbyrange.jsx
: Select circles within a diameter range.
Usage: Run script, enter min/max diameter (mm or pt). -
selectobjectsbybounds.jsx
: Select objects by width and height ranges.
Usage: Run script, enter min/max width and height (mm or pt).
Ensure your document is open and objects are unlocked and visible before running.
This guide explains how to install and run two Adobe Illustrator ExtendScript (JSX) utilities for selecting objects by size.
- selectcirclesbyrange.jsx — Selects circular items (including symbol instances) within a diameter range.
- selectobjectsbybounds.jsx — Selects any items by width/height ranges.
- Open your Illustrator document.
- Save the desired script as a
.jsx
file. - Illustrator → File → Scripts → Other Script… → choose your
.jsx
. - Follow the prompts.
Copy .jsx
files into the Illustrator Scripts folder, then restart Illustrator.
- macOS:
/Applications/Adobe Illustrator [version]/Presets/en_US/Scripts
- Windows:
C:\\Program Files\\Adobe\\Adobe Illustrator [version]\\Presets\\en_US\\Scripts
The scripts will appear under File → Scripts.
- Accepted units:
mm
andpt
. - If no unit is entered, the scripts default to
mm
. - A small internal tolerance is used to handle rounding (no exact match required).
- Prompts for Minimum diameter and Maximum diameter (leave blank for none).
- Treats items with
width ≈ height
as circles. - Scans visible, unlocked items (paths, compound paths, symbol instances by rendered bounds).
- Result: matching items are selected; a dialog displays the count.
Examples
- Min:
50mm
, Max:100mm
→ selects circles 50–100 mm in diameter. - Min:
200pt
, Max: (blank) → selects circles ≥ 200 pt. - Min: (blank), Max:
75mm
→ selects circles ≤ 75 mm.
- Prompts for min/max width and min/max height (leave any blank for none).
- Matches any PageItem with width/height (paths, groups, compound paths, symbol instances, etc.).
- Skips hidden/locked items.
- Result: matching items are selected; a dialog displays the count.
Examples
- Width
>= 20mm
and Height<= 40mm
. - Width between
10mm
–30mm
, Height between10mm
–30mm
.
- Save your document before running selections on large files.
- Lock or hide layers you don’t want processed to reduce scan time.
- Prefer these targeted scripts over Select → Same on very large documents.
- Illustrator’s ExtendScript engine is ES3-level JavaScript.
- Avoid modern JS features when modifying scripts (e.g.,
trim
,let/const
, arrow functions). - Use ES3-safe patterns (e.g., manual whitespace trim with regex) as already included in these scripts.
- Nothing selected: Check units and ranges; verify items are visible/unlocked and meet criteria.
- Invalid input: Enter numeric value plus optional unit (
12
,34mm
,48pt
). - Script not in menu: Ensure file extension is
.jsx
and Illustrator was restarted after copying. - Symbol instances not caught (circles script): Ensure the instances actually render as circles (equal width/height) and fit the range.
- Both scripts run in O(n) over
pageItems
and are faster than appearance-based global selection. - Tolerance defaults:
- Circles: ~0.25 pt for width≈height, ±0.5 pt for range checks.
- Bounds: ~0.25 pt for range checks.