Illustrator Script Collection
100 free ExtendScript tools for Adobe Illustrator, covering text, paths, color, layers, export, effects, cleanup and more. Cross-platform compatible with Illustrator CS6 through CC 2025.
What's Included
A production-ready toolkit organized into 10 categories, built by Mapsoft's Illustrator development team. Need something beyond the free scripts?
100 Scripts
Covering text, paths, color, layers, selection, export, document setup, effects, cleanup and utility operations.
Cross-Platform
All scripts work on both Mac and Windows without modification. Platform-agnostic file paths and no OS-specific APIs.
Production Ready
ScriptUI dialogs for configuration, error handling for edge cases, and full undo support via Ctrl/Cmd+Z.
Installation
Copy to Scripts Folder
Locate your Illustrator Scripts folder:
Windows: C:\Program Files\Adobe\Adobe Illustrator [version]\Presets\en_US\Scripts\
Mac: /Applications/Adobe Illustrator [version]/Presets/en_US/Scripts/
Copy the script folders (Text, Path, Color, etc.) into the Scripts directory.
Restart Illustrator. Scripts will appear under File > Scripts.
Alternative: Run Directly
Go to File > Scripts > Other Script... (Ctrl/Cmd+F12), navigate to the .jsx file and click Open. The script runs immediately.
Tip: Keyboard Shortcuts
For frequently used scripts, assign keyboard shortcuts via Edit > Keyboard Shortcuts > Menu Commands > File > Scripts.
Getting Started with Illustrator Scripting
A short orientation if you’re new to ExtendScript — what it is, when it beats clicking, and how to write your first script.
What is ExtendScript?
ExtendScript is Adobe’s scripting language for Creative Cloud applications — a dialect of ECMAScript 3 (an older JavaScript) with Adobe-specific extensions for talking to Illustrator, Photoshop, InDesign, and the rest of the suite. A script is a plain-text .jsx file. You don’t need to compile anything, install a build chain, or set up a project — just save the file and run it via File > Scripts > Other Script…
If you already write JavaScript, the syntax will feel familiar. The main quirks are that let and const aren’t available (use var), arrow functions don’t exist, and console.log is replaced by $.writeln (writing to the ExtendScript Toolkit / VSCode debug console).
When scripting beats clicking
The simple test: if you’re about to do the same operation more than ten times, or you need to do it on a folder of files, ExtendScript will save you time. The Actions panel records and replays simple sequences but can’t handle conditionals, file system access, or anything that needs logic. ExtendScript can. Above ExtendScript sits CEP panels (for persistent UI) and the C++ SDK (for performance-critical work) — the full landscape is mapped in our guide to Illustrator extension technologies.
Your first script: rename every layer
Here’s a complete script that renames every layer in the active document with a sequential prefix. Save it as rename-layers.jsx and run it from File > Scripts > Other Script…
// rename-layers.jsx — rename layers with a numeric prefix
(function () {
if (app.documents.length === 0) {
alert('Open a document first.');
return;
}
var doc = app.activeDocument;
for (var i = 0; i < doc.layers.length; i++) {
var layer = doc.layers[i];
layer.name = (i + 1).toString() + ' - ' + layer.name;
}
alert('Renamed ' + doc.layers.length + ' layers.');
}());
Three things worth pointing out: the IIFE wrapper ((function () { ... }())) keeps your variables out of Illustrator’s global scope; the app.documents.length === 0 check is the standard guard for "nothing to do"; and app.activeDocument is the entry point to almost every Illustrator scripting operation.
ScriptUI dialogs for user input
Most production scripts need to ask the user something — a prefix, a folder, an export preset. ScriptUI is the framework for those dialogs. The 100 scripts in the catalog below all use ScriptUI; the install-step in their headers is a good reference for the patterns.
Debugging
The two reliable approaches are: (1) drop $.writeln('value: ' + x); calls into your script and run it from the ExtendScript Toolkit (legacy, but still works) or the VSCode "Adobe ExtendScript Debugger" extension, which gives you breakpoints and a step-through debugger; or (2) use alert() for quick checkpoints when you don’t want to set up a debugger session. Most production debugging settles into VSCode + the ExtendScript debugger.
When to graduate from a script
The signs that ExtendScript has hit its limit: you need a UI panel that stays visible while users work; you need to call a web API or do anything async; performance is a problem (ExtendScript is interpreted, single-threaded, and slower than native code); or you need to install on dozens of machines. At that point, look at CEP HTML panels for persistent UI, or the C++ SDK for speed and deep API access.
Learn More About Illustrator Scripting
Production-grade patterns and decision frameworks from the Mapsoft blog.
Illustrator Automation: When Scripting Beats Clicking
The threshold of "do it once" vs "script it", the four levers (Actions, ExtendScript, CEP, C++ SDK), and the practical decision framework for picking the right tool.
Illustrator Batch Processing
Production-grade folder loops, naming conventions, error handling, and multi-format export — the next step after a single script.
Using Illustrator Scripts to Modify Colors
Automate color changes across artwork with ExtendScript — RGB, CMYK, spot colors, recursive traversal, and brand recolouring.
Illustrator Variable Data Workflows
One template, a CSV manifest, and personalised PDF output for every row — the practical pipeline from Variables panel to production-scale VDP.
Illustrator Map Production Workflows
From GIS handoff to print-ready PDF/X-4 — layer architecture, symbol libraries, scripted map series, and cartographic export.
Script Catalog
Browse all 100 scripts organized by category. Each script includes ScriptUI dialogs for configuration.
Text & Typography
15 scripts
Scripts for manipulating text frames, fonts, and typographic properties.
| Script | Description | Use Case |
|---|---|---|
ConvertPointToAreaText.jsx | Converts point text to area text with auto-sized bounds | Reformatting legacy text for responsive layouts |
FindReplaceInSelection.jsx | Find and replace text within selected frames only | Targeted text edits without affecting entire document |
SetTextSizeByDialog.jsx | Set font size with absolute, relative (+5), or percentage (150%) modes | Quick bulk font size adjustments |
ListAllFontsUsed.jsx | Lists all fonts with usage counts, exportable to file | Pre-flight font auditing before handoff |
ChangeTextCase.jsx | UPPER, lower, Title, Sentence, or tOGGLE case conversion | Fixing text case without retyping |
SplitTextFrameByLines.jsx | Splits multi-line text into individual text frames per line | Animating or individually positioning text lines |
JoinTextFrames.jsx | Merges multiple text frames into one with sort options | Consolidating scattered text into a single frame |
TextFrameAutofit.jsx | Auto-resizes area text frames to fit their content | Eliminating overflow or excess empty space |
OutlineTextPerFrame.jsx | Converts text to outlines keeping each frame as a separate group | Clean text-to-path conversion preserving organization |
AddTextPrefix.jsx | Adds prefix/suffix or auto-numbering to text frames | Batch numbering, bullet points, wrapping text |
AlignTextFramesToBaseline.jsx | Aligns text frames by their visual baseline | Precise text alignment across different font sizes |
TextStatistics.jsx | Character, word, line, paragraph counts with type breakdown | Content auditing and copywriting metrics |
ReplaceFont.jsx | Replace one font with another throughout the document | Font substitution for brand updates |
SetLineSpacing.jsx | Set leading with absolute, auto, or relative-to-font modes | Uniform line spacing across text frames |
ExtractTextToFile.jsx | Exports all document text to a file, organized by layer | Content extraction for translation or review |
HighlightOverflowText.jsx | Finds overflowing area text and marks them with red outlines | Catching hidden overflow text before print |
Path & Shape
15 scripts
Scripts for path manipulation, shape creation, and geometric transformations.
| Script | Description | Use Case |
|---|---|---|
CloseOpenPaths.jsx | Closes open paths with straight or smooth curve options | Preparing paths for fill, print, or CNC cutting |
RemoveRedundantPoints.jsx | Removes anchor points that don't affect the path shape | Simplifying paths imported from tracing or CAD |
SplitPathAtAnchors.jsx | Splits paths into individual segments at each anchor | Breaking complex paths for individual editing |
RoundCorners.jsx | Adds rounded corners to any angular path | Creating rounded rectangles from any polygon |
MirrorPath.jsx | Creates mirrored copies across horizontal/vertical axis | Symmetrical design creation |
OffsetPathSimple.jsx | Creates offset copies at specified distances | Making concentric shapes, border effects |
RandomizeAnchors.jsx | Randomly displaces anchor points for organic effects | Creating hand-drawn, natural-looking shapes |
AddPointsToPath.jsx | Subdivides path segments with bezier-accurate interpolation | Adding detail to smooth curves |
PathLengthInfo.jsx | Calculates path length in points, inches, and millimetres | Measuring paths for cutting, engraving, or pricing |
CreateGrid.jsx | Creates customisable grids with gutters and margins | Layout grids, game boards, technical drawings |
ConvertStrokeToFill.jsx | Outlines strokes using Illustrator's built-in command | Preparing strokes for print or laser cutting |
DuplicateAlongPath.jsx | Places copies of an object at equal intervals along a path | Pattern creation, decorative borders, animations |
ResizeToExactDimensions.jsx | Resize to exact width/height in pt, in, mm, or px | Precise sizing for production specifications |
CreateSpiralPath.jsx | Creates Archimedean or logarithmic spirals | Decorative elements, generative design |
CreateWavyLine.jsx | Creates sine, triangle, or square wave patterns | Decorative borders, sound wave graphics |
FlattenTransparency.jsx | Flattens transparency for print-ready output | Print preparation for older RIP workflows |
Color Management
11 scripts
Scripts for color conversion, swatch management, and color manipulation.
| Script | Description | Use Case |
|---|---|---|
ConvertRGBtoCMYK.jsx | Converts RGB colors to CMYK equivalents | Preparing screen designs for print |
ConvertCMYKtoRGB.jsx | Converts CMYK colors to RGB equivalents | Adapting print files for digital use |
ConvertToGrayscale.jsx | Perceptual luminance-based grayscale conversion | Creating grayscale versions, accessibility testing |
SwapFillAndStroke.jsx | Swaps fill and stroke colors on selected objects | Quick appearance toggling |
RandomizeFillColors.jsx | Applies random colors with HSB range constraints | Pattern design, data visualization, generative art |
CreateColorHarmony.jsx | Generates complementary, triadic, analogous palettes | Color palette generation from a base color |
AdjustBrightness.jsx | Lightens or darkens colors by percentage | Creating hover states, tint variations |
ColorReport.jsx | Lists all colors with values, types, and usage counts | Color auditing, brand compliance checking |
RemoveUnusedSwatches.jsx | Removes swatches not used by any object | Cleaning up swatch panel clutter |
ApplyColorFromSwatch.jsx | Applies a swatch to selected objects with searchable list | Quick color application from the palette |
SetOpacityByDialog.jsx | Set opacity with absolute, relative, or random modes | Batch opacity adjustments for layered effects |
Layer Management
10 scripts
Scripts for organizing, merging, and managing layers.
| Script | Description | Use Case |
|---|---|---|
MergeSelectedLayers.jsx | Merges multiple layers into one via a dialog | Consolidating layers before handoff |
DeleteEmptyLayers.jsx | Removes all empty layers and sublayers | Cleaning up layer panel clutter |
DuplicateToAllArtboards.jsx | Copies objects to same position on all artboards | Placing headers, logos, page numbers across artboards |
LockAllExceptActive.jsx | Locks all layers except the active one | Isolating work on a single layer |
UnlockAllLayers.jsx | Unlocks all layers and optionally all objects | Quick access to all elements for editing |
RenameLayersByContent.jsx | Auto-names layers based on their content | Organizing unnamed "Layer 1, 2, 3..." layers |
MoveSelectionToNewLayer.jsx | Moves selection to a new named layer | Organizing objects into proper layers |
ToggleLayerVisibility.jsx | Show all, hide all, solo, toggle, or invert visibility | Quick layer visibility management |
FlattenAllLayers.jsx | Merges all layers into one | Pre-export simplification |
CreateLayerFromSelection.jsx | Creates one layer per object or one for all selected | Auto-organizing objects into layers |
Selection Utilities
10 scripts
Scripts for advanced selection filtering and management.
| Script | Description | Use Case |
|---|---|---|
SelectByFillColor.jsx | Selects all objects matching a reference fill color | Batch editing same-colored elements |
SelectByStrokeWeight.jsx | Selects objects with a specific stroke weight | Finding and modifying strokes of a certain weight |
SelectBySize.jsx | Selects objects by width, height, or area thresholds | Finding objects that don't meet size requirements |
SelectByObjectType.jsx | Selects all objects of a chosen type (path, text, etc.) | Batch operations on specific object types |
SelectSameAppearance.jsx | Selects objects matching fill, stroke, and weight | Finding visually identical elements |
InvertSelection.jsx | Inverts current selection | Selecting "everything except these" |
SelectOnActiveArtboard.jsx | Selects objects within the active artboard bounds | Artboard-specific batch operations |
SelectOpenPaths.jsx | Selects all unclosed paths in the document | Pre-flight check for paths needing closure |
SelectSmallObjects.jsx | Finds objects below a size threshold, offers delete | Removing tiny artefacts and debris |
SelectStrayPoints.jsx | Finds single-point paths, offers delete | Cleaning up invisible stray anchor points |
Export & Batch Processing
9 scripts
Scripts for exporting to various formats and batch operations.
| Script | Description | Use Case |
|---|---|---|
ExportArtboardsAsPNG.jsx | Exports each artboard as PNG with resolution and @2x/@3x | Multi-resolution asset generation |
ExportArtboardsAsSVG.jsx | Exports artboards as SVG with font and precision options | Web icon and asset export |
ExportArtboardsAsPDF.jsx | Exports as separate PDFs or single multi-page PDF | Print-ready PDF generation |
BatchExportOpenDocs.jsx | Exports all open documents to PNG, JPG, SVG, or PDF | Processing multiple files at once |
ExportSelectionAsPNG.jsx | Exports only selected objects as a cropped PNG | Quick asset extraction from a larger composition |
ExportLayersAsFiles.jsx | Exports each layer as a separate file | Layer-based asset pipelines |
ExportForWeb.jsx | One-click web export: PNG @1x/@2x/@3x + SVG in subfolders | Complete web asset package generation |
SaveAsEPS.jsx | Save as EPS with version and preview configuration | Legacy format compatibility for print |
ExportColorSwatches.jsx | Exports swatches as CSV, JSON, CSS variables, or plain text | Color handoff to developers or documentation |
Document Setup
8 scripts
Scripts for artboard management, guides, and document configuration.
| Script | Description | Use Case |
|---|---|---|
CreateArtboardsFromSelection.jsx | Creates artboards sized to each selected object | Auto-generating artboards around existing art |
FitArtboardToArt.jsx | Resizes artboard to fit artwork with optional padding | Trimming artboards to content |
DocumentInfo.jsx | Comprehensive doc info: dimensions, counts, fonts, links | Pre-flight documentation and auditing |
AddGuidesFromSelection.jsx | Creates guides at selection edges and/or centers | Alignment reference from existing elements |
RenameArtboards.jsx | Batch rename artboards with patterns or custom lists | Organizing artboards for export naming |
ResizeArtboard.jsx | Resize to exact dimensions or standard presets | Quick artboard resizing (A4, Letter, web sizes) |
AddBleedMarks.jsx | Adds crop, bleed, and center marks for print | Manual print mark generation |
SetupColumnGrid.jsx | Creates column grid as guides or colored rectangles | Layout design with Bootstrap-style grids |
Effects & Appearance
8 scripts
Scripts for visual effects and creative transformations.
| Script | Description | Use Case |
|---|---|---|
CreateDropShadow.jsx | Adds configurable drop shadow via duplicated offset shape | Quick shadow effects without live effects |
CreateLongShadow.jsx | Creates trendy flat-design long shadow effect | Material design, flat illustration shadows |
GradientFillAcrossObjects.jsx | Applies color gradient across multiple objects | Color transitions in infographics, charts |
CreateDottedLine.jsx | Places circles/squares/diamonds along a path | Decorative borders, stitching effects |
CreateOutlineEffect.jsx | Concentric outlines with fading opacity for glow/halo | Neon glow, highlight effects |
RandomDistribute.jsx | Randomly positions objects with optional rotation/scale | Scattered layouts, confetti, natural patterns |
Cleanup & Optimization
10 scripts
Scripts for document cleanup, optimization, and maintenance.
| Script | Description | Use Case |
|---|---|---|
RemoveHiddenObjects.jsx | Finds and removes all hidden objects | Reducing file size, removing legacy hidden art |
RemoveUnusedSymbols.jsx | Removes symbol definitions not placed in the document | Cleaning up Symbols panel |
RemoveEmptyGroups.jsx | Recursively removes empty group containers | Structural cleanup after editing |
RemoveAllGuides.jsx | Removes all guide objects and ruler guides | Fresh start on guide placement |
UngroupAll.jsx | Recursively ungroups all groups in selection or document | Flattening structure for export or editing |
CleanupDocument.jsx | All-in-one: stray points, empty groups, hidden items, and more | Comprehensive pre-delivery cleanup |
ReplaceLinkedWithEmbedded.jsx | Embeds all linked images into the document | Packaging files without missing links |
ResetTransformations.jsx | Resets position transformations on selected objects | Starting fresh on object positioning |
FindReplaceObjectNames.jsx | Find/replace text in object names (Layers panel) | Bulk renaming for SVG export IDs |
ReducePathPoints.jsx | Simplifies paths by reducing anchor point count | Optimizing complex traced or imported paths |
Utility
2 scripts
General-purpose productivity scripts.
| Script | Description | Use Case |
|---|---|---|
BatchRenameObjects.jsx | Sequential renaming with prefix, numbering, and sorting | SVG element ID naming, organized layer names |
DistributeSpacingEvenly.jsx | Equal gaps between objects (not equal center spacing) | Precise layout spacing that accounts for object sizes |
Common Workflows
Combine scripts for end-to-end production workflows.
Print Preparation
- Run
CleanupDocument.jsxto remove stray points, empty groups, hidden objects - Run
ConvertRGBtoCMYK.jsxto convert colors for print - Run
ReplaceLinkedWithEmbedded.jsxto embed all images - Run
ListAllFontsUsed.jsxto audit fonts - Run
HighlightOverflowText.jsxto catch overflow text - Run
AddBleedMarks.jsxfor crop marks - Run
ExportArtboardsAsPDF.jsxfor final output
Web Asset Generation
- Run
ExportForWeb.jsxfor automatic PNG @1x/@2x/@3x + SVG export - Run
ExportColorSwatches.jsxwith CSS output for developer handoff - Run
BatchRenameObjects.jsxto set meaningful SVG element IDs
Brand Guidelines
- Run
ColorReport.jsxto audit all colors used - Run
CreateColorHarmony.jsxto generate palette variations - Run
ExportColorSwatches.jsxin JSON format for digital style guides - Run
ListAllFontsUsed.jsxto document typography
File Cleanup
- Run
SelectStrayPoints.jsxand delete - Run
RemoveEmptyGroups.jsx - Run
RemoveHiddenObjects.jsx - Run
RemoveUnusedSwatches.jsx - Run
RemoveUnusedSymbols.jsx - Run
DeleteEmptyLayers.jsx
Compatibility
Tested and supported across all modern Illustrator versions on Mac and Windows.
Platform: Mac OS X 10.12+ / Windows 10/11
Technical Notes
- Scripts use ExtendScript (.jsx), Adobe's JavaScript implementation for Creative Suite/Cloud applications.
- All scripts are wrapped in IIFEs
(function() { ... })()to avoid polluting the global scope. - Color conversions use standard mathematical formulas (ITU-R BT.709 for luminance).
- Path calculations use cubic Bezier interpolation for accurate curve measurements.
- File I/O operations use
FileandFolderobjects from ExtendScript's cross-platform API.
Production Work the Free Scripts Can't Finish?
These 100 scripts handle the everyday artwork tasks. When you need die-line generators, variable-artwork pipelines, SKU-driven packaging, or production systems that run headless — that's what Mapsoft's Illustrator team builds.
Custom Illustrator Development
We've been writing Illustrator automation for packaging, signage, technical illustration, and print-production studios for decades. Typical projects:
- Die-line and packaging artwork generation from CSV, JSON, or ERP data
- Variable artwork and SKU-level variant production at scale
- SVG and PDF export pipelines for web catalogs and online stores
- Technical illustration tooling — callouts, exploded views, regulatory labels
- Print-production scripts for imposition, trap, spot-color, and pre-flight
Which Illustrator task do you wish was automated?
We refresh this collection regularly. Tell us either a new feature you'd love to see or an existing script that let you down — we'll consider it for the next release, or quote you for a bespoke version.
Prefer email? Write to support@mapsoft.com with the script name and what you'd like improved.
Need a script we don’t ship? Or one of ours customized?
The 100 scripts above cover the common cases — the work most studios reach for once a week. Bespoke automation, system integration, multi-app pipelines, and production-grade builds (CSV-driven map series, prepress workflows, enterprise-deployed internal tools) are what Mapsoft’s consultancy and custom development teams do day-to-day. If the free collection nearly fits but doesn’t quite, that’s the gap we close.
Download the Collection
Get all 100 Illustrator scripts in a single download. Free to use, modify, and distribute.