Official agent skill

Adobe Illustrator Scripting

by github in github/awesome-copilot

Write, debug, and optimize Adobe Illustrator automation scripts using ExtendScript (JavaScript/JSX).

OfficialMITAuto-check passedFrontend & Design

Install Adobe Illustrator Scripting

skills CLI
$ npx skills add github/awesome-copilot --skill adobe-illustrator-scripting -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install github/awesome-copilot adobe-illustrator-scripting --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/github/awesome-copilot.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/adobe-illustrator-scripting .claude/skills/adobe-illustrator-scripting && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
adobe-illustrator-scripting
GitHub stars
40k
Used in
1 other repo
Token cost
~8.8k tokens
SKILL.md length
2,100 words
Files
5 (incl. scripts, references)
Skills in repo
417
Repo updated
First seen
Licence
MIT

At a glance

Write, debug, and optimize Adobe Illustrator automation scripts using ExtendScript (JavaScript/JSX).

  • Modifying scripts that manipulate documents
  • SKILL.md covers Bundled Assets, When to Use This Skill, Prerequisites and Scripting Environment, plus 6 more sections
  • Any Illustrator DOM objects

What it does

Adobe Illustrator Scripting is an agent skill from github/awesome-copilot, published by the product's own GitHub organization. Write, debug, and optimize Adobe Illustrator automation scripts using ExtendScript (JavaScript/JSX). Use when creating or modifying scripts that manipulate documents, layers, paths, text frames, colors, symbols, artboards, or any Illustrator DOM objects. Covers the complete JavaScript object model, coordinate system, measurement units, export workflows, and scripting best practices.

Its SKILL.md is about 8.8k tokens, which your agent loads only when the skill is triggered. The skill folder holds 6 other files, including scripts and reference files (for example `references/object-model-quick-reference.md`).

It sits in Frontend & Design, covering React components. It works with Adobe Illustrator and JavaScript. The repository describes itself as: Community-contributed instructions, agents, skills, and configurations to help you make the most of GitHub Copilot. The licence is MIT.

When your agent uses it

  • Modifying scripts that manipulate documents
  • Any Illustrator DOM objects

Example prompts

  • “/adobe-illustrator-scripting”

What it can do on your machine

Read from SKILL.md and the folder at commit 727ff2e. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 3 files in scripts/, which the agent can run.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • ai-scripting.docsforadobe.dev

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Adobe Illustrator Scripting loads about 8.8k tokens when it runs, and up to ~10k if it reads all its reference files. Until then it costs about 103 tokens; SKILL.md has 2,100 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~103
When it runs · the whole SKILL.md, loaded when a task matches
~8.8k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~10k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from github/awesome-copilot at commit 727ff2e, republished under its MIT licence (© github). 2,100 words, ~8,756 tokens.

Download SKILL.mdSave it as .claude/skills/adobe-illustrator-scripting/SKILL.md (or your agent's skills folder). This skill also uses 4 other files; get the full folder from GitHub.
name
adobe-illustrator-scripting
description
Write, debug, and optimize Adobe Illustrator automation scripts using ExtendScript (JavaScript/JSX). Use when creating or modifying scripts that manipulate documents, layers, paths, text frames, colors, symbols, artboards, or any Illustrator DOM objects. Covers the complete JavaScript object model, coordinate system, measurement units, export workflows, and scripting best practices.

Adobe Illustrator Scripting

Expert guidance for automating Adobe Illustrator through ExtendScript (JavaScript/JSX). This skill covers the Illustrator scripting object model, all major API objects, code patterns, and best practices for writing production-quality .jsx scripts.

Bundled Assets

  • references/object-model-quick-reference.md: Use this as a quick lookup for the Illustrator scripting object model, common document and page item types, and related DOM concepts while writing or debugging scripts.
  • scripts/: Contains example Illustrator automation scripts you can use as starting points or implementation patterns for common tasks such as document manipulation, exports, batch processing, and DOM usage. Review and adapt these examples when you need working JSX patterns or want to compare behavior while debugging.

When to Use This Skill

  • Writing new Illustrator automation scripts (.jsx or .js files)
  • Debugging or fixing existing Illustrator ExtendScript code
  • Manipulating documents, layers, page items, paths, text, or colors programmatically
  • Batch-processing Illustrator files or generating artwork from data
  • Exporting documents to various formats (PDF, SVG, PNG, EPS, etc.)
  • Working with the Illustrator DOM (Application, Document, Layer, PathItem, TextFrame, etc.)
  • Creating data-driven graphics using variables and datasets
  • Automating print workflows with scripted print options

Prerequisites

  • Adobe Illustrator CC or later installed
  • Basic JavaScript knowledge (ExtendScript is ES3-based with Adobe extensions)
  • Scripts are executed via File > Scripts > Other Scripts, the Scripts menu, or placed in the Startup Scripts folder
  • The ExtendScript Toolkit (ESTK) or any text editor can be used to write .jsx files

Scripting Environment

Language and File Extensions
LanguageExtensionPlatform
ExtendScript/JavaScript.jsx, .jsWindows, macOS
AppleScript.scptmacOS only
VBScript.vbsWindows only

This skill focuses on ExtendScript/JavaScript as the cross-platform, most widely used option.

Executing Scripts
  • Scripts menu: File > Scripts lists scripts from the application scripts folder
  • Other Scripts: File > Scripts > Other Scripts to browse and run any .jsx file
  • Startup Scripts: Place scripts in the Startup Scripts folder to run automatically on launch
  • Target directive: Begin scripts with #target illustrator when running from ESTK or external tools
  • #targetengine directive: Use #targetengine "session" to persist variables across script executions
  • External invocation: Scripts are frequently launched from outside Illustrator — by shell scripts, task runners, CI jobs, ExtendScript Toolkit (ExtendScript Toolkit.exe -run script.jsx), or BridgeTalk messages from other Adobe apps. See External Invocation & Argument Passing.
Naming Conventions (JavaScript)
  • Objects and properties use camelCase: activeDocument, pathItems, textFrames
  • The app global references the Application object
  • Collection indices are zero-based: documents[0] is the frontmost document
  • Use typename property to identify object types at runtime

Object Model Overview

The Illustrator DOM follows a strict containment hierarchy:

Application (app)
├── activeDocument / documents[]
│   ├── layers[]
│   │   ├── pageItems[] (all artwork)
│   │   ├── pathItems[]
│   │   ├── compoundPathItems[]
│   │   ├── textFrames[]
│   │   ├── placedItems[]
│   │   ├── rasterItems[]
│   │   ├── meshItems[]
│   │   ├── pluginItems[]
│   │   ├── graphItems[]
│   │   ├── symbolItems[]
│   │   ├── nonNativeItems[]
│   │   ├── legacyTextItems[]
│   │   └── groupItems[]
│   ├── artboards[]
│   ├── views[]
│   ├── selection (array of selected items)
│   ├── swatches[], spots[], gradients[], patterns[]
│   ├── graphicStyles[], brushes[], symbols[]
│   ├── textFonts[] (via app.textFonts)
│   ├── stories[], characterStyles[], paragraphStyles[]
│   ├── variables[], datasets[]
│   └── inkList[], printOptions
├── preferences
├── printerList[]
└── textFonts[]
Top-Level Objects
  • Application (app): The root object. Provides access to documents, preferences, fonts, and printers. Key properties: activeDocument, documents, textFonts, printerList, userInteractionLevel, version.
  • Document: Represents an open .ai file. Key properties: layers, pageItems, selection, activeLayer, width, height, rulerOrigin, documentColorSpace. Key methods: saveAs(), exportFile(), close(), print().
  • Layer: A drawing layer. Key properties: pageItems, pathItems, textFrames, visible, locked, opacity, name, zOrderPosition, color.

Measurement Units and Coordinates

Units

All scripting API values use points (72 points = 1 inch). Convert other units:

UnitConversion
Inchesmultiply by 72
Centimetersmultiply by 28.346
Millimetersmultiply by 2.834645
Picasmultiply by 12

Kerning, tracking, and aki properties use em units (thousandths of an em, proportional to font size).

Coordinate System
  • For scripted documents, the origin (0,0) is at the bottom-left of the artboard
  • X increases left to right; Y increases bottom to top
  • The position property of a page item is the top-left corner of its bounding box as [x, y]
  • Maximum page item width/height: 16348 points
Art Item Bounds

Every page item has three bounding rectangles:

  • geometricBounds: Excludes stroke width [left, top, right, bottom]
  • visibleBounds: Includes stroke width
  • controlBounds: Includes control/direction points

Working with Documents

Creating and Opening
javascript
// Create a new document
var doc = app.documents.add();

// Create with a preset
var preset = new DocumentPreset();
preset.width = 612;  // 8.5 inches
preset.height = 792; // 11 inches
preset.colorMode = DocumentColorSpace.CMYK;
var doc = app.documents.addDocument("Print", preset);

// Open an existing file
var fileRef = new File("/path/to/file.ai");
var doc = app.open(fileRef);
Saving and Exporting
javascript
// Save as Illustrator format
var saveOpts = new IllustratorSaveOptions();
saveOpts.compatibility = Compatibility.ILLUSTRATOR17; // CC
doc.saveAs(new File("/path/to/output.ai"), saveOpts);

// Export as PDF
var pdfOpts = new PDFSaveOptions();
pdfOpts.compatibility = PDFCompatibility.ACROBAT7;
pdfOpts.preserveEditability = false;
doc.saveAs(new File("/path/to/output.pdf"), pdfOpts);

// Export as PNG
var pngOpts = new ExportOptionsPNG24();
pngOpts.horizontalScale = 300;
pngOpts.verticalScale = 300;
pngOpts.transparency = true;
doc.exportFile(new File("/path/to/output.png"), ExportType.PNG24, pngOpts);

// Export as SVG
var svgOpts = new ExportOptionsSVG();
svgOpts.fontType = SVGFontType.OUTLINEFONT;
doc.exportFile(new File("/path/to/output.svg"), ExportType.SVG, svgOpts);

Working with Paths and Shapes

Built-in Shape Methods

The pathItems collection provides convenience methods for common shapes:

javascript
var doc = app.activeDocument;
var layer = doc.activeLayer;

// Rectangle: rectangle(top, left, width, height)
var rect = layer.pathItems.rectangle(500, 100, 200, 150);

// Rounded rectangle: roundedRectangle(top, left, width, height, hRadius, vRadius)
var rrect = layer.pathItems.roundedRectangle(500, 100, 200, 150, 20, 20);

// Ellipse: ellipse(top, left, width, height)
var oval = layer.pathItems.ellipse(400, 200, 100, 100);

// Polygon: polygon(centerX, centerY, radius, sides)
var hex = layer.pathItems.polygon(300, 300, 50, 6);

// Star: star(centerX, centerY, radius, innerRadius, points)
var star = layer.pathItems.star(300, 300, 50, 25, 5);
Freeform Paths Using Coordinate Arrays
javascript
var doc = app.activeDocument;
var path = doc.pathItems.add();
path.setEntirePath([[100, 100], [200, 200], [300, 100]]);
path.closed = false;
path.stroked = true;
path.strokeWidth = 2;
Freeform Paths Using PathPoint Objects
javascript
var doc = app.activeDocument;
var path = doc.pathItems.add();

var point1 = path.pathPoints.add();
point1.anchor = [100, 100];
point1.leftDirection = [100, 100];
point1.rightDirection = [150, 150];
point1.pointType = PointType.SMOOTH;

var point2 = path.pathPoints.add();
point2.anchor = [300, 100];
point2.leftDirection = [250, 150];
point2.rightDirection = [300, 100];
point2.pointType = PointType.SMOOTH;

path.closed = false;
Path Properties
javascript
var item = doc.pathItems[0];
item.filled = true;
item.stroked = true;
item.strokeWidth = 1.5;
item.strokeCap = StrokeCap.ROUNDENDCAP;
item.strokeJoin = StrokeJoin.ROUNDENDJOIN;
item.opacity = 80;
item.closed = true;

Working with Colors

Color Objects
javascript
// RGB Color (values 0-255)
var red = new RGBColor();
red.red = 255;
red.green = 0;
red.blue = 0;

// CMYK Color (values 0-100)
var cyan = new CMYKColor();
cyan.cyan = 100;
cyan.magenta = 0;
cyan.yellow = 0;
cyan.black = 0;

// Grayscale (0-100, 0 = black)
var gray = new GrayColor();
gray.gray = 50;

// Lab Color
var lab = new LabColor();
lab.l = 50;
lab.a = 20;
lab.b = -30;

// No color (transparent)
var none = new NoColor();
Applying Colors
javascript
var item = doc.pathItems[0];
item.fillColor = red;
item.strokeColor = cyan;

// Gradient fill
var gradient = doc.gradients.add();
gradient.type = GradientType.LINEAR;
gradient.gradientStops[0].color = red;
gradient.gradientStops[1].color = cyan;

var gradColor = new GradientColor();
gradColor.gradient = gradient;
item.fillColor = gradColor;
Spot Colors and Swatches
javascript
// Create a spot color
var spot = doc.spots.add();
spot.name = "My Spot Color";
spot.color = red; // Base color definition

var spotColor = new SpotColor();
spotColor.spot = spot;
spotColor.tint = 100;

item.fillColor = spotColor;

// Access a swatch by name
var swatch = doc.swatches.getByName("PANTONE 185 C");
item.fillColor = swatch.color;

Working with Text

Text Frame Types
javascript
var doc = app.activeDocument;

// Point text
var pointText = doc.textFrames.add();
pointText.contents = "Hello World!";
pointText.position = [100, 500];

// Area text (text inside a path)
var rectPath = doc.pathItems.rectangle(500, 100, 200, 100);
var areaText = doc.textFrames.areaText(rectPath);
areaText.contents = "Text inside a rectangle shape.";

// Path text (text along a path)
var curvePath = doc.pathItems.add();
curvePath.setEntirePath([[50, 300], [150, 400], [250, 300]]);
var pathText = doc.textFrames.pathText(curvePath);
pathText.contents = "Text on a path";
Character and Paragraph Formatting
javascript
var tf = doc.textFrames[0];
var textRange = tf.textRange;

// Character attributes
var charAttr = textRange.characterAttributes;
charAttr.size = 24;           // Font size in points
charAttr.textFont = app.textFonts.getByName("ArialMT");
charAttr.fillColor = red;
charAttr.tracking = 50;       // Em units
charAttr.horizontalScale = 100;
charAttr.verticalScale = 100;
charAttr.baselineShift = 0;

// Paragraph attributes
var paraAttr = textRange.paragraphAttributes;
paraAttr.justification = Justification.CENTER;
paraAttr.firstLineIndent = 0;
paraAttr.leftIndent = 0;
paraAttr.spaceBefore = 0;
paraAttr.spaceAfter = 0;
Accessing Text Content
javascript
var tf = doc.textFrames[0];

// Access sub-ranges
var firstChar = tf.characters[0];
var firstWord = tf.words[0];
var firstPara = tf.paragraphs[0];
var firstLine = tf.lines[0];

// Modify specific ranges
tf.words[0].characterAttributes.size = 36;
tf.paragraphs[0].paragraphAttributes.justification = Justification.LEFT;
Threading Text Frames
javascript
var frame1 = doc.textFrames.areaText(path1);
var frame2 = doc.textFrames.areaText(path2);

// Link frames so text flows from frame1 to frame2
frame1.nextFrame = frame2;

// Stories represent the full text across threaded frames
var storyCount = doc.stories.length;
var fullText = doc.stories[0].textRange.contents;

Working with Layers

javascript
var doc = app.activeDocument;

// Create a layer
var newLayer = doc.layers.add();
newLayer.name = "Background";
newLayer.visible = true;
newLayer.locked = false;
newLayer.opacity = 100;

// Access existing layers
var topLayer = doc.layers[0];
var layerByName = doc.layers.getByName("Background");

// Move items between layers
var item = doc.pathItems[0];
item.move(newLayer, ElementPlacement.PLACEATBEGINNING);

// Reorder layers
newLayer.zOrder(ZOrderMethod.SENDTOBACK);

Working with Selections

javascript
// Get current selection
var sel = app.activeDocument.selection;

// Iterate selected items
for (var i = 0; i < sel.length; i++) {
    var item = sel[i];
    // Check type using typename
    if (item.typename === "PathItem") {
        item.fillColor = red;
    } else if (item.typename === "TextFrame") {
        item.contents = "Modified";
    }
}

// Select an item programmatically
doc.pathItems[0].selected = true;

// Deselect all
doc.selection = null;

Working with Symbols

javascript
// Place a symbol instance
var sym = doc.symbols.getByName("MySymbol");
var instance = doc.symbolItems.add(sym);
instance.position = [200, 400];

// Access symbol definition
var symDef = instance.symbol;

// Break link to symbol (expand to regular art)
instance.breakLink();

Transformations

javascript
var item = doc.pathItems[0];

// Rotate 45 degrees around center
item.rotate(45);

// Scale to 50% width, 75% height
item.resize(50, 75);

// Translate (move) by 100 points right and 50 points up
item.translate(100, 50);

// Using a transformation matrix
var matrix = app.getIdentityMatrix();
matrix = app.concatenateRotationMatrix(matrix, 30);
matrix = app.concatenateScaleMatrix(matrix, 150, 150);
item.transform(matrix);

Working with Artboards

javascript
var doc = app.activeDocument;

// Access artboards
var ab = doc.artboards[0];
var rect = ab.artboardRect; // [left, top, right, bottom]

// Create a new artboard
var newAB = doc.artboards.add([0, 0, 612, 792]); // Letter size
newAB.name = "Page 2";

// Set active artboard
doc.artboards.setActiveArtboardIndex(1);

Data-Driven Graphics (Variables and Datasets)

javascript
// Variables link document items to data fields
var v = doc.variables.add();
v.kind = VariableKind.TEXTUAL;
v.name = "headline";

// Link a text frame to the variable
var tf = doc.textFrames[0];
tf.contentVariable = v;

// Create datasets for batch content
var ds = doc.dataSets.add();
ds.name = "Version 1";
// Dataset captures current variable bindings

// Switch datasets to swap content
doc.dataSets[0].display();

Printing

javascript
var doc = app.activeDocument;
var opts = new PrintOptions();

opts.printPreset = "Default";

// Paper options
var paperOpts = new PrintPaperOptions();
paperOpts.name = "Letter";
opts.paperOptions = paperOpts;

// Job options
var jobOpts = new PrintJobOptions();
jobOpts.copies = 1;
jobOpts.designation = PrintArtworkDesignation.VISIBLELAYERS;
opts.jobOptions = jobOpts;

doc.print(opts);

User Interaction Levels

Control whether Illustrator shows dialogs during script execution:

javascript
// Suppress all dialogs
app.userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS;

// Perform operations that might prompt dialogs...
doc.close(SaveOptions.DONOTSAVECHANGES);

// Restore dialog display
app.userInteractionLevel = UserInteractionLevel.DISPLAYALERTS;

Working with Methods (JavaScript-Specific)

When calling methods with multiple optional parameters, use undefined to skip middle parameters:

javascript
// rotate(angle, [changePositions], [changeFillPatterns], [changeFillGradients], ...)
item.rotate(30, undefined, undefined, true);

External Invocation & Argument Passing

Illustrator scripts are routinely launched from outside the application — shell scripts, schedulers, build pipelines, ExtendScript Toolkit, or BridgeTalk messages from other Creative Cloud apps. The execution environment under those launchers differs from the in-application File > Scripts path in several ways that frequently break otherwise-correct code.

arguments[] Is Unreliable Under External Launchers

ExtendScript Toolkit's -run invocation and BridgeTalk.send() do not forward arbitrary launcher arguments into the script's top-level arguments[] array. In many configurations the array contains a single [object BridgeTalk] element instead of the values the caller passed, as demonstrated below:

javascript
// At top of script
var passed = (typeof arguments !== "undefined") ? arguments : [];
for (var i = 0; i < passed.length; i++) {
    $.writeln("arg[" + i + "] = " + passed[i]);
    // Often prints: arg[0] = [object BridgeTalk]
}

Do not rely on arguments[] for required inputs when the script is launched externally. Use one of the following more reliable channels.

Sidecar File for Parameters

When a script fails under an external launcher and the source of the error is not obvious, fall back to a sidecar file: have the caller write a small text file at a known absolute path, and read it on startup. This works regardless of launcher quirks and is easy to inspect after a failed run.

javascript
var SIDECAR_PATH = "C:/Users/userName/job.args.txt";

function readSidecar(path) {
    var f = new File(path);
    if (!f.exists || !f.open("r")) return null;
    var lines = [];
    while (!f.eof) {
        var ln = f.readln();
        if (ln && !/^\s*$/.test(ln)) lines.push(ln);
    }
    f.close();
    return {
        input:  lines[0],
        output: lines[1],
        mode:   lines[2]
    };
}

A key=value format is equally workable and avoids positional fragility:

text
input=C:/path/to/input.ai
output=C:/path/to/output.pdf
mode=preview
Environment Variables

$.getenv("NAME") returns environment variables visible to Illustrator's process, not the launcher's. If the launcher needs Illustrator to see a value, it must set the variable system-wide or in Illustrator's parent environment before launching. For per-invocation values, prefer a sidecar file.

$.fileName and File($.fileName).parent

Under in-application execution, $.fileName is the absolute path of the running script and File($.fileName).parent yields the script's folder. Under some external launchers (notably ESTK -run) $.fileName can be empty, causing relative path resolution to silently fail.

javascript
// Fragile: returns null under some launchers
var here = $.fileName ? File($.fileName).parent : null;
var sidecar = here ? new File(here.fsName + "/job.args.txt") : null;

// Robust: hardcode a known absolute path or fall back to a stable location
var sidecar = new File("C:/Users/userName/job.args.txt");
if (!sidecar.exists) sidecar = new File(Folder.temp.fsName + "/job.args.txt");
Diagnostic Logging to an Absolute Path

Silent failures are common because dialogs are suppressed and the launcher may not surface $.writeln output. Write a plain-text log to a known absolute path so a run can be inspected after the fact. Create the parent folder on demand so the first call cannot fail for a missing directory.

javascript
var LOG_PATH = "C:/Users/userName/logs/job.log";

function log(msg) {
    try {
        var f = new File(LOG_PATH);
        try { if (!f.parent.exists) f.parent.create(); } catch (eDir) {}
        if (f.open("a")) {
            f.writeln("[" + new Date() + "] " + msg);
            f.close();
        }
    } catch (e) {}
}
Wrap the Entry Point in try { ... } catch

Externally launched scripts often fail without any visible indication. A top-level try/catch that writes the error to the log file converts silent failures into a single inspectable line.

javascript
try {
    main();
} catch (err) {
    log("FATAL: " + err + (err && err.line ? " line=" + err.line : ""));
}
Suppress User Interaction

External callers cannot answer dialogs. Disable them before any DOM work and avoid alert() / confirm() / prompt() entirely in scripts that may be launched headlessly.

javascript
app.userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS;
Save Explicitly

Closing or letting Illustrator return to its idle state does not save the working file. After all DOM edits, call doc.saveAs(...) (or doc.save()) explicitly and log whether it succeeded.

javascript
var opts = new IllustratorSaveOptions();
opts.compatibility = Compatibility.ILLUSTRATOR17;
doc.saveAs(new File(doc.fullName.fsName), opts);

Common Patterns

Iterate All Page Items in a Document
javascript
function processAllItems(doc) {
    for (var i = 0; i < doc.pageItems.length; i++) {
        var item = doc.pageItems[i];
        // Process based on type
        switch (item.typename) {
            case "PathItem":
                // handle path
                break;
            case "TextFrame":
                // handle text
                break;
            case "GroupItem":
                // handle group (may contain nested items)
                break;
        }
    }
}
Recursively Unlock Layers and Groups Before Editing

A locked layer or any locked ancestor (parent group, clip group, sublayer) will cause edits to throw Error: Target layer cannot be modified. Walk the full hierarchy and clear locked / hidden flags before performing DOM modifications.

javascript
function unlockAll(doc) {
    function visitLayers(layers) {
        for (var i = 0; i < layers.length; i++) {
            var lyr = layers[i];
            try { lyr.locked = false; lyr.visible = true; } catch (e) {}
            visitItems(lyr);
            if (lyr.layers && lyr.layers.length) visitLayers(lyr.layers);
        }
    }
    function visitItems(container) {
        var items = container.pageItems;
        for (var j = 0; j < items.length; j++) {
            var it = items[j];
            try { it.locked = false; it.hidden = false; } catch (e) {}
            if (it.typename === "GroupItem") visitItems(it);
        }
    }
    visitLayers(doc.layers);
}

PlacedItem.file = newFile replaces a linked image while preserving the parent, stacking order, and (after re-applying) the bounds. RasterItem does not expose a writable file property, so when a placeholder is a raster you must add a fresh PlacedItem in the same parent, copy the bounds, then remove the original.

javascript
function relinkOrRebuild(item, newFile) {
    var bounds = item.geometricBounds.slice();
    var parent = item.parent;
    var name   = item.name;

    if (item.typename === "PlacedItem") {
        item.file = newFile;
        item.geometricBounds = bounds;
        return item;
    }

    // RasterItem path: rebuild as a linked PlacedItem in the same parent.
    var fresh = parent.placedItems.add();
    fresh.file = newFile;
    fresh.geometricBounds = bounds;
    if (name) try { fresh.name = name; } catch (e) {}
    fresh.move(item, ElementPlacement.PLACEBEFORE);
    item.remove();
    return fresh;
}
Show full SKILL.md (863 more words)Show less
Placing SVG Content (Copy/Paste Pattern)

PlacedItem.file accepts raster formats and AI/PDF, but not SVG. Setting it to an .svg File throws Unable to set placed item's file, is the file path provided valid?. The reliable way to bring SVG artwork into a document is to open the SVG as a separate document, select all, copy, close, and paste into the working document.

javascript
function placeSVG(targetDoc, svgFile, targetLayer) {
    var donor = app.open(svgFile);
    app.executeMenuCommand("selectall");
    app.executeMenuCommand("copy");
    donor.close(SaveOptions.DONOTSAVECHANGES);

    app.activeDocument = targetDoc;
    targetDoc.activeLayer = targetLayer;
    app.executeMenuCommand("pasteFront");

    var sel = targetDoc.selection;
    if (!sel || sel.length === 0) return null;
    if (sel.length === 1) return sel[0];

    // Multiple pasted items: group them so callers get a single handle.
    var group = targetLayer.groupItems.add();
    for (var i = sel.length - 1; i >= 0; i--) {
        sel[i].move(group, ElementPlacement.PLACEATBEGINNING);
    }
    return group;
}
Finding a Clipping Path Inside a Mask Group

Clip groups expose their clipping shape as a child PathItem (or, less commonly, a child of a CompoundPathItem) with clipping === true. The clip's geometricBounds give the visible frame to size or center content against.

javascript
function findClipPath(group) {
    var items = group.pageItems;
    for (var i = 0; i < items.length; i++) {
        var it = items[i];
        try {
            if (it.typename === "PathItem" && it.clipping) return it;
            if (it.typename === "CompoundPathItem") {
                for (var j = 0; j < it.pathItems.length; j++) {
                    if (it.pathItems[j].clipping) return it;
                }
            }
        } catch (e) {}
    }
    return null;
}
Cover-Fit and Contain-Fit Sizing

To make an image fully cover a rectangle (any overflow hidden by a mask), use the larger of the width/height ratios. To make it fit entirely inside, use the smaller. A bleed factor (e.g. 1.10) lets a cover image extend slightly past the clip edge.

javascript
function fitItemToRect(item, rect, mode, bleed) {
    // rect = [L, T, R, B] (Illustrator: T > B)
    var rw = rect[2] - rect[0];
    var rh = rect[1] - rect[3];
    var ib = item.geometricBounds;
    var iw = ib[2] - ib[0];
    var ih = ib[1] - ib[3];
    if (iw <= 0 || ih <= 0) return;

    var sx = rw / iw;
    var sy = rh / ih;
    var s  = (mode === "cover" ? Math.max(sx, sy) : Math.min(sx, sy))
           * (bleed || 1);
    item.resize(s * 100, s * 100);

    var cx = (rect[0] + rect[2]) / 2;
    var cy = (rect[1] + rect[3]) / 2;
    var b  = item.geometricBounds;
    var w  = b[2] - b[0];
    var h  = b[1] - b[3];
    item.position = [cx - w / 2, cy + h / 2];
}
Batch Process Files in a Folder
javascript
var folder = Folder.selectDialog("Select folder of .ai files");
if (folder) {
    var files = folder.getFiles("*.ai");
    for (var i = 0; i < files.length; i++) {
        var doc = app.open(files[i]);
        // Process each document...
        doc.close(SaveOptions.DONOTSAVECHANGES);
    }
}
Error Handling
javascript
try {
    var doc = app.activeDocument;
    var layer = doc.layers.getByName("NonExistentLayer");
} catch (e) {
    alert("Error: " + e.message);
    // e.message, e.line, e.fileName available
}

Troubleshooting

  • "undefined is not an object": Usually means the collection is empty or the index is out of bounds. Check .length before accessing items.
  • Script runs but nothing changes visually: Call app.redraw() to force a screen refresh after modifications.
  • Color mode mismatch: Document color space (RGB vs CMYK) must match color objects. Use doc.documentColorSpace to check.
  • Position seems wrong: Remember scripted documents use bottom-left origin with Y increasing upward. The position property is the top-left of the bounding box.
  • Text not appearing: Ensure the text frame has a non-zero size. For point text, set position; for area text, provide a valid path to areaText().
  • File paths on Windows: Use forward slashes (/) or double backslashes (\\) in path strings, or use the File object constructor.
  • Dialog boxes interrupting batch scripts: Set app.userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS before batch operations.
  • Collections use getByName(): Many collection objects support getByName("name") which throws an error if not found; wrap in try/catch.
  • "Target layer cannot be modified": A locked layer, sublayer, or parent group (often a clip group like Cover_Mask) is blocking the edit. Recursively clear locked and hidden across the document before modifying. See Recursively Unlock Layers and Groups.
  • "Unable to set placed item's file, is the file path provided valid?": The file exists and the path is correct, but PlacedItem.file does not accept the format. SVG is the most common cause — use the open / copy / paste pattern instead.
  • RasterItem.file = newFile does nothing or throws: RasterItem does not expose a writable file property. Add a new PlacedItem to the same parent, restore the bounds and name, then .remove() the raster.
  • arguments[0] is [object BridgeTalk] (or empty): The script was launched through ESTK -run or a BridgeTalk message; positional arguments are not forwarded. Use a sidecar file at a known absolute path. See External Invocation & Argument Passing.
  • $.fileName is empty: Same external-launcher cause. Do not derive resource paths from $.fileName in scripts that may be invoked headlessly — use absolute paths or Folder.temp.
  • Script appears to do nothing: Almost always either a locked ancestor, suppressed dialogs swallowing the error, or a missing explicit saveAs after edits. Add a top-level try/catch that logs to an absolute path to confirm execution and capture the error.
  • item.resize(sx, sy) recentered the artwork unexpectedly: resize defaults to scaling around the item's center (Transformation.CENTER). Pass an explicit scaleAbout argument or follow with translate(dx, dy) to reposition.

Scripting Constants Reference

Common enumeration constants used across the API:

CategoryConstants
Color SpaceDocumentColorSpace.RGB, DocumentColorSpace.CMYK
JustificationJustification.LEFT, Justification.CENTER, Justification.RIGHT, Justification.FULLJUSTIFY
Point TypePointType.SMOOTH, PointType.CORNER
Stroke CapStrokeCap.BUTTENDCAP, StrokeCap.ROUNDENDCAP, StrokeCap.PROJECTINGENDCAP
Stroke JoinStrokeJoin.MITERENDJOIN, StrokeJoin.ROUNDENDJOIN, StrokeJoin.BEVELENDJOIN
Blend ModeBlendModes.NORMAL, BlendModes.MULTIPLY, BlendModes.SCREEN, BlendModes.OVERLAY
Save OptionsSaveOptions.SAVECHANGES, SaveOptions.DONOTSAVECHANGES, SaveOptions.PROMPTTOSAVECHANGES
Export TypeExportType.PNG24, ExportType.PNG8, ExportType.JPEG, ExportType.SVG, ExportType.TIFF, ExportType.PHOTOSHOP, ExportType.AUTOCAD, ExportType.FLASH
Element PlacementElementPlacement.PLACEATBEGINNING, ElementPlacement.PLACEATEND, ElementPlacement.PLACEBEFORE, ElementPlacement.PLACEAFTER, ElementPlacement.INSIDE
Z-OrderZOrderMethod.BRINGTOFRONT, ZOrderMethod.SENDTOBACK, ZOrderMethod.BRINGFORWARD, ZOrderMethod.SENDBACKWARD
Gradient TypeGradientType.LINEAR, GradientType.RADIAL
Text Frame KindTextType.POINTTEXT, TextType.AREATEXT, TextType.PATHTEXT
Variable KindVariableKind.TEXTUAL, VariableKind.IMAGE, VariableKind.VISIBILITY, VariableKind.GRAPH
User InteractionUserInteractionLevel.DISPLAYALERTS, UserInteractionLevel.DONTDISPLAYALERTS
CompatibilityCompatibility.ILLUSTRATOR10 through Compatibility.ILLUSTRATOR24

JavaScript Object Reference (Complete API Object List)

The Illustrator JavaScript API contains the following objects, grouped by category:

Core Objects

Application, Document, Documents, DocumentPreset, Layer, Layers, PageItem, PageItems, View, Views, Preferences

Path and Shape Objects

PathItem, PathItems, PathPoint, PathPoints, CompoundPathItem, CompoundPathItems, GroupItem, GroupItems

Text Objects

TextFrame, TextRange, TextRanges, TextPath, Characters, Words, Paragraphs, Lines, InsertionPoint, InsertionPoints, Story, Stories, CharacterAttributes, ParagraphAttributes, CharacterStyle, CharacterStyles, ParagraphStyle, ParagraphStyles, TextFont, TextFonts, TabStopInfo

Color Objects

RGBColor, CMYKColor, GrayColor, LabColor, NoColor, SpotColor, Spot, Spots, PatternColor, GradientColor, Color, Gradient, Gradients, GradientStop, GradientStops

Swatch and Style Objects

Swatch, Swatches, SwatchGroup, SwatchGroups, GraphicStyle, GraphicStyles, Pattern, Patterns, Brush, Brushes

Symbol Objects

Symbol, Symbols, SymbolItem, SymbolItems

Artboard Objects

Artboard, Artboards

Placed and Raster Objects

PlacedItem, PlacedItems, RasterItem, RasterItems, MeshItem, MeshItems, GraphItem, GraphItems, PluginItem, PluginItems, NonNativeItem, NonNativeItems, LegacyTextItem, LegacyTextItems

Data-Driven Objects

Variable, Variables, Dataset, Datasets

Matrix and Transform Objects

Matrix

Tag Objects

Tag, Tags

Tracing Objects

TracingObject, TracingOptions

Save and Export Options

IllustratorSaveOptions, EPSSaveOptions, PDFSaveOptions, FXGSaveOptions, ExportOptionsAutoCAD, ExportOptionsFlash, ExportOptionsGIF, ExportOptionsJPEG, ExportOptionsPhotoshop, ExportOptionsPNG8, ExportOptionsPNG24, ExportOptionsSVG, ExportOptionsTIFF

Open Options

OpenOptions, OpenOptionsAutoCAD, OpenOptionsFreeHand, OpenOptionsPhotoshop, PDFFileOptions, PhotoshopFileOptions

Print Objects

PrintOptions, PrintJobOptions, PrintPaperOptions, PrintColorManagementOptions, PrintColorSeparationOptions, PrintCoordinateOptions, PrintFlattenerOptions, PrintFontOptions, PrintPageMarksOptions, PrintPostScriptOptions, Printer, PrinterInfo, Paper, PaperInfo, PPDFile, PPDFileInfo, Ink, InkInfo, Screen, ScreenInfo, ScreenSpotFunction

Image and Rasterize Options

ImageCaptureOptions, RasterEffectOptions, RasterizeOptions

References

  • Changelog - Recent scripting API changes (CC 2020 added Document.getPageItemFromUuid and PageItem.uuid; CC 2017 added Application.getIsFileOpen)
  • Illustrator Scripting Guide - Full community-maintained documentation

© github, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 4 other files (scripts, references) in skills/adobe-illustrator-scripting of github/awesome-copilot.

  • SKILL.md
  • references/object-model-quick-reference.md
  • scripts/batch-export-png.jsx
  • scripts/create-color-grid.jsx
  • scripts/find-replace-text.jsx

Open the folder on GitHubat commit 727ff2e

Used in 1 other repository

We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in github/awesome-copilot, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Adobe Illustrator Scripting next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Adobe Illustrator Scripting compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Adobe Illustrator Scripting this skillgithub/awesome-copilot40k1 repos~8.8kAutomated safety check: PassMIT
Tailwindcss Developmentanonaddy/anonaddy4.9k10 repos~865Automated safety check: PassMIT
Pierre Trees File Treepierrecomputer/pierre6.2k—~473Automated safety check: PassApache-2.0
Gea Frameworkdashersw/gea1.3k—~4.8kAutomated safety check: PassMIT
Typescript Best Practicesbretzel-app/crumbs1271 repos~2.2kAutomated safety check: PassMIT
Connect Component To Figmadequelabs/cauldron129—~2kAutomated safety check: PassMPL-2.0

Similar skills

  • Tailwindcss Development

    anonaddy/anonaddy

    Always invoke when the user's message includes 'tailwind' in any form.

    4.9k GitHub starsUsed in 10 repos~865 tokens
    Frontend & DesignAuto-check passed
  • Pierre Trees File Tree

    pierrecomputer/pierre

    Use when an app uses @pierre/trees to render or control a file tree, including React, vanilla JavaScript, SSR, web components, selection, search, rename, drag…

    6.2k GitHub stars~473 tokensUpdated today
    Frontend & DesignAuto-check passed
  • Gea Framework

    dashersw/gea

    A skill your agent uses when creating Gea applications, components, stores, routes, SSR entry points, JSX templates, or working with Gea reactivity and DOM patching.

    1.3k GitHub stars~4.8k tokensUpdated 7 days ago
    Frontend & DesignAuto-check passed
  • Typescript Best Practices

    bretzel-app/crumbs

    Provides TypeScript patterns for type-first development, making illegal states unrepresentable, exhaustive handling, and runtime validation.

    127 GitHub starsUsed in 1 repo~2.2k tokens
    Frontend & DesignAuto-check passed
  • Connect Component To Figma

    dequelabs/cauldron

    Add a Figma Code Connect (.figma.tsx) file for a Cauldron React component.

    129 GitHub stars~2k tokensUpdated today
    Frontend & DesignAuto-check passed
  • Fork And Go

    SimplePDF/simplepdf-embed

    Guided walkthrough for forking and deploying your own SimplePDF Copilot: hosting choice, Pro-account confirmation, AI-provider wiring, demo customization, deploy, and the SimplePDF whitelist step.

    407 GitHub stars~7.9k tokensUpdated 7 days ago
    Frontend & DesignAuto-check: notes

More from github/awesome-copilot

All 417 skills in this repo
  • Acquire Codebase Knowledge

    github/awesome-copilot

    Official

    Maps an unfamiliar codebase into seven evidence-backed documents in docs/codebase/, using a scan script and templates, for onboarding or architecture write-ups.

    40k GitHub starsUsed in 1 repo~2.3k tokens
    Auto-check passed
  • Azure Architecture Autopilot

    github/awesome-copilot

    Official

    Designs Azure infrastructure from a natural-language description, or diagrams an existing resource group, then refines the design through conversation and deploys it with Bicep.

    40k GitHub starsUsed in 1 repo~1.9k tokens
    Auto-check passed
  • Draw.io Diagram Generator

    github/awesome-copilot

    Official

    Generates, edits and validates draw.io files with correct mxGraph XML, covering flowcharts, architecture, sequence, ER and UML class diagrams.

    40k GitHub starsUsed in 1 repo~4.9k tokens
    Auto-check passed
  • Credit Risk Data Cleaning

    github/awesome-copilot

    Official

    Cleans raw credit data and screens variables before loan modeling, dropping unstable, noisy or redundant features and writing an Excel report of every step.

    40k GitHub starsUsed in 1 repo~1.5k tokens
    Auto-check passed
  • Daily Focus Board

    github/awesome-copilot

    Official

    Builds a warm, browser-based daily focus board the user updates by talking to their agent, with Eisenhower priorities, a brain-dump box and kind not-today carryover.

    40k GitHub stars~3k tokensUpdated today
    Auto-check passed
  • Python Pypi Package Builder

    github/awesome-copilot

    Official

    End-to-end skill for building, testing, linting, versioning, and publishing a production-grade Python library to PyPI.

    40k GitHub starsUsed in 1 repo~4.6k tokens
    Auto-check passed

Questions about Adobe Illustrator Scripting

What does Adobe Illustrator Scripting do?

Write, debug, and optimize Adobe Illustrator automation scripts using ExtendScript (JavaScript/JSX). Adobe Illustrator Scripting is an agent skill from github/awesome-copilot, published by the product's own GitHub organization. Write, debug, and optimize Adobe Illustrator automation scripts using ExtendScript (JavaScript/JSX).

When should I use Adobe Illustrator Scripting?

Adobe Illustrator Scripting fits situations like: modifying scripts that manipulate documents; any Illustrator DOM objects.

How do I install Adobe Illustrator Scripting in Claude Code?

Run `npx skills add github/awesome-copilot --skill adobe-illustrator-scripting -a claude-code`. Or copy the skill folder (skills/adobe-illustrator-scripting in github/awesome-copilot) into .claude/skills/adobe-illustrator-scripting in your project. Claude Code loads it when a task matches its description.

How do I install Adobe Illustrator Scripting in Codex?

Run `npx skills add github/awesome-copilot --skill adobe-illustrator-scripting -a codex`. Or copy the skill folder (skills/adobe-illustrator-scripting in github/awesome-copilot) into .agents/skills/adobe-illustrator-scripting in your project. Codex loads it when a task matches its description.

Can I use Adobe Illustrator Scripting in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add github/awesome-copilot --skill adobe-illustrator-scripting -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/adobe-illustrator-scripting, .gemini/skills/adobe-illustrator-scripting, .github/skills/adobe-illustrator-scripting and .opencode/skills/adobe-illustrator-scripting in your project.

What does Adobe Illustrator Scripting need to run?

SKILL.md names no scripts, command-line tools or credentials: Adobe Illustrator Scripting is instructions for the agent only.

Does Adobe Illustrator Scripting access the network?

SKILL.md names 1 domain. As links in the text: ai-scripting.docsforadobe.dev. This is read from the text; nothing was executed.

Is Adobe Illustrator Scripting safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Adobe Illustrator Scripting use?

Adobe Illustrator Scripting is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Adobe Illustrator Scripting use?

About 8.8k tokens (SKILL.md is roughly 35k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.3k tokens, read only when the agent opens those files.

What are the alternatives to Adobe Illustrator Scripting?

Skills that share tags, products or a category with Adobe Illustrator Scripting: Tailwindcss Development (anonaddy/anonaddy, 4.9k stars), Pierre Trees File Tree (pierrecomputer/pierre, 6.2k stars), Gea Framework (dashersw/gea, 1.3k stars) and Typescript Best Practices (bretzel-app/crumbs, 127 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Adobe Illustrator Scripting?

github (a GitHub organization, an official publisher) maintains it in github/awesome-copilot, which has 39,748 GitHub stars. The repository holds 417 skills in this directory. The repository was last updated on October 7, 2026.

Source: github/awesome-copilot on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.