Welcome to my playground for Adobe Illustrator scripting. Along with the scripts and utilities detailed below, you can also find some fun tests and example scripts in the snippets directory. Have fun! ✌️
Getting Started
- Download the repository ZIP archive to your computer.
- Install script files from the
jsx
directory into your Presets folder (learn how). - Restart Illustrator.
Script Categories
- Alignment Scripts
- Artboard Scripts
- Color Scripts
- Layer Scripts
- Path Scripts
- Production Scripts
- Selection Scripts
- Text Scripts
- Utility Scripts
Match one or more objects to another by size, position, rotation, and more.
Offset selected objects vertically or horizontally by stacking order or artboard placement.
Flood fill the active artboard with the current fill color.
Easily add a rectangle guide offset +/- from your current artboard.
Export all artboards to individual Ai files.
Export all artboards to individual PDF files.
Export the current artboard to an Ai file.
Export the current artboard to a PDF file.
Randomly color selected objects.
Features:
- choose between Full RGB, a single color (adjustable tints), or grayscale values
- works with text words or individual characters
Rename layers using find and replace (regex enabled).
Show or Hide layers in Adobe Illustrator using find (regex enabled).
Sometimes when selecting path points using the Direct Selection Tool or Lasso Tool, path segments also get selected making anchor point manipulation difficult. This script selects only the path points (not path segments) from your current selection.
Remove bezier handles from selected anchor points.
Export proper print and cut PDFs for decal and signage production.
Note
This script was created specifically for a decal vendor I work with and is not currently customizable so it may not fit your exact requirement but can easily be adjusted. Let me know if you need any help?
Easily repeat Illustrator objects across row and columns (with visual preview). Useful for production layout, grid/pattern generation, and step-and-repeat operations.
Includes:
- Customize rows, columns, and gutters
- Repeat pattern options grid, brick-by-row, brick-by-column
- Ability to save presets, with customizable default and last used settings
- Pick different object bounds to base layout from
- Option to fill active artboard with repeats (with padding)
Easily add screen printing registration marks and spot color info to a document for printing separations.
Includes:
- Customize registration mark size, placement(s), color, and inset
- Label film separations with spot color name
- Output can also include file name and timestamp
- Can be re-run at any time to update data
- Ability to save custom presets
Easily find and select objects in your Adobe Illustrator document by name. Supports both simple string searches and powerful regular expression matching. Ideal for quickly filtering and managing complex artwork layers and groups.
Visualize every font on your system with customizable text.
Note
Depending on the number of fonts on your system, this script can take a while to complete. If you want to speed things up, you can change the setting updateScreen = false
. For example, to process all 2500 fonts on my system, it takes 2 minutes with the default settings. With updateScreen
set to false
, the processing time reduces to 20 seconds (83% time decrease).
- DrawVisibleBounds
- GetObjectPlacementInfo
- GetVisibleBounds
- GroupObjectByRow
- Logger
- ReleaseAllContainers
- ReleaseGroup
Draw "visible" bounds marks around Illustrator PageItems. A PageItem's visible bounds are determined using the GetVisibleBounds utility function.
// usage example
var doc = app.activeDocument;
var sel = doc.selection;
var boundMarkLength = 12; // points
var boundMarkStrokeWeight = 1.5; // points
var customBoundMarkColor = new RGBColor();
customBoundMarkColor.red = 0;
customBoundMarkColor.green = 0;
customBoundMarkColor.blue = 255;
drawVisibleBounds(sel, boundMarkLength, boundMarkStrokeWeight, customBoundMarkColor);
Provide the bounds of a PageItem
and get all of its placement information. Includes left
, top
, right
, bottom
, width
, height
, centerX
, and centerY
.
var myObject = app.activeDocument.pageItems[0]
var myObjectPlacementInfo = getObjectPlacementInfo(myObject.visibleBounds)
Determine the actual "visible" bounds for an object accounting for clipping mask and compound paths.
var clippedObject = app.activeDocument.pageItems[0]
var bounds = getVisibleBounds(clippedObject)
Take an array of Adobe Illustrator pageItems and group them by vertical separation.
Note
This script was designed to group text characters but works just fine for most types of pageItems.
Module for easy file logging from within Adobe ExtendScript.
Features:
- timestamps
- "append" or "write" modes
- file size rotation
- optional forwarding of any writes to the console via
$.writeln()
- multiple argument concatenation
logger.log("arg1", "arg2", "arg3")
var logFile = Folder.userData + "example.log";
logger = new Logger(logFilePath);
logger.log("hello, world!");
Clean-up junky files by releasing all selected containers (groups, compound paths, and clipping masks).
Note
This script isn't rocket science, it just recursively runs Ungroup, Clipping Mask Release, and Compound Path Release until no more container objects exist. I found this method works no matter how nested the container objects are and performs far better for weird edge cases than trying to remove each element from withing each container via the API.
Release objects from within a group container similar to Object > Ungroup
but can also works recursively.