日本語の README はこちらです。
Adobe Illustrator Scripts

This is a collection of scripts for Adobe Illustrator. I created it with simplicity and ease of use in mind.
Click the titles to jump to learn more about the script.
If you find a script that interests you, please download it from
.
Artboard

Color

Layer

Link

Path

Text

Utility

View

Preferences

Libraries
For developers. Libraries of frequently used functions here.
Installation
Download the zip archive from
or
Releases and unzip it.
The scripts can be placed anywhere on your computer.
To run the scripts, from File > Scripts > Other Script( ⌘ / Ctrl + F12 ).
[!NOTE]
In rare cases, the script may not work if you continue to use it.
In this case, restart Illustrator and try again.
Extensions, software
The following extensions or software make it easy to run scripts.
UI
ScriptUI Dialog Builder (SDB) was used to design the UI.
See also: ScriptUI-Dialog-Builder-Joonas.
Development Environment
OS: macOS Ventura 13.7.1
Test: Adobe Illustrator 2020-2024
License
All scripts are licensed under the MIT license.
See the included LICENSE file for more details.

This script adds any number of anchor points evenly spaced.
It is a slightly more user-friendly improvement to Object > Path > Add Anchor Points.

Usage
- Select two or more anchor points with the Direct Selection Tool, and run this script.
- Enter the number of anchor points to add.
Anchor points for type on a path and area type are also supported.
Requirements
Illustrator CS4 or higher

This script changes a number to a 3-digit comma delimited string.

Usage
Select text objects or specify a text range in an editing state, and run this script.
Requirements
Illustrator CS or higher

This script adds selected gradients to Swatches.

Usage
Select path objects, and run this script.
Text object and stroke color are not supported.
Requirements
Illustrator CS or higher

This script adjusts selected handle lengths and angles.

Usage
- Select two or more anchor points with the Direct Selection Tool, and run this script.
- Select a length and an angle.
Requirements
Illustrator CS4 or higher

This script aligns objects in the center of space.
For example, alignInCenterOfSpace(Vertical).js:

Usage
Select three or more objects, and run this script.
The position of alignment depends on the reference point.
[!NOTE]
Include or exclude the stroke width depends on the Align panel menu > Use Preview Bounds.
Select at least three objects.
Requirements
Illustrator CS3 or higher

This script aligns objects horizontally and vertically at the same time.

Usage
- Select any objects, and run this script.
- Select the Distribute Objects or the Distribute Spacing.
If you don’t want evenly spaced distribution, uncheck both checkboxes.
- To include stroke width, check the Use Preview Bounds checkbox.
- Enter a value of the Alignment Position Tolerance. (0 or higher number)

- Click the Align icon button.
[!NOTE]
The top row and the left-most column are the basis for alignment.
Compound paths, texts, linked files, and embedded files are also supported.
Support units
Point, Pixel, Pica, Inch, Feet, Yard, Millimeter, Centimeter, Meter.
These units depend on the ruler units.
Requirements
Illustrator 2021 or higher

This script splits and arranges all open windows.
The Arrange document icon has been implemented in the Application Bar since version 2022.

Usage
Just run this script.
Requirements
Illustrator CS6 or higher

This script replaces missing links, linked and embedded files in bulk.
Since version 2024, the Apply to All checkbox has been removed from the dialog that appears when there are missing link files. As a result, it is no longer possible to replace files in bulk using this dialog.

Usage
- Select any missing link, linked or embedded files, and run this script.
- Select a new file.
- For PDF, select a crop to option and enter a page number from the import options.
When selecting linked files, select them in the document rather than the Links panel.
Requirements
Illustrator CS6 or higher

This script checks the day of the week.

Usage
Select a date section in the text with the cursor, and run this script.
If there is no year, it will considered as this year.
The following formats are supported.
YYYY/MM/DD, MM/DD/YYYY, DD/MM/YYYY,
YYYY-MM-DD, MM-DD-YYYY, DD-MM-YYYY,
YYYY.MM.DD, MM.DD.YYYY, DD.MM.YYYY,
YYYY MM DD, MM DD YYYY, DD MM YYYY,
Jan(uary) (the) DD(st|nd|rd|th)(,) YYYY, MM DD(st|nd|rd|th)(,) YYYY,
DD(st|nd|rd|th) (of) Jan(uary)(,) YYYY, DD(st|nd|rd|th) MM(,) YYYY,
YYYY年MM月DD日, 令和YY年MM月DD日, 平成YY年MM月DD日, 昭和YY年MM月DD日, 大正YY年MM月DD日, 明治YY年MM月DD日
Requirements
Illustrator CS4 or higher

This script closes all documents.
It has been implemented in the File menu since version 2021.
Usage
Just run this script. If there are unsaved documents, choose to save them or not.
Requirements
Illustrator CS4 or higher

This script closes the path objects.

Usage
Select the path objects, and run this script.
Requirements
Illustrator CS or higher

This script compares the scales of two objects.

Usage
- Select two objects, and run this script.
- To include stroke width, check the Use Preview Bounds checkbox.
Support units
Point, Pixel, Pica, Inch, Feet, Yard, Millimeter, Centimeter, Meter.
These units depend on the ruler units.
Requirements
Illustrator CC or higher

This script converts all anchor points to the corner.
The anchor point conversion options in the Control panel require the anchor point to be selected, but this script selects the entire object.

Usage
Select the entire path with the Selection Tool, and run this script.
If you select anchor points with the Direct Selection Tool, a dialog will show to convert all or only selected anchor points to corner points.

Anchor points for type on a path and area type are also supported.
Requirements
Illustrator CS4 or higher

This script converts any colors in the Swatches panel to global or spot colors.
convertToGlobalColor.js:

convertToSpotColor.js:

Usage
Select colors in the Swatches panel, and run this script.
If not selected, all swatches are converted.
[!NOTE]
If there is a swatch with the same name, it will not convert.
When converting a process color to a global or spot color, the order in which the colors display changes because they reregister in the swatch.
Requirements
Illustrator CS or higher

This script converts types on a path to point types.

Usage
Select type on a path object, and run this script.
[!NOTE]
The original type objects will delete.
Any effects applied in the appearance will be lost.
Requirements
Illustrator CS or higher

This script is equivalent to Visual Studio Code’s Selection >
Copy Line Down( Option / Alt + Shift + ↓ ) &
Copy Line Up( Option / Alt + Shift + ↑ ).
If you assign shortcuts using Keyboard Maestro, AutoHotkey or similar,
you will be able to achieve more of a Visual Studio Code feel.
Both point and area types are supported.
For example, copyLineDown.js:

Usage
Move the cursor to the line you want to copy, and run this script.
It is not necessary to select a line.
Since using copy and paste functions inside the script, it will lose if you have copied the content in advance.
[!NOTE]
Area type with wrapping may not work well.
In the case of copyLineDown.js, when copying the last line, a new line is added to work around a bug.
Only one line can be copied. Multiple lines are not supported.
If you are using version 2020 or earlier, you will not be able to enter keyboard input after running the script.
If you want to enter text, you must click with the mouse.
Requirements
Illustrator CC 2018 or higher

This script is equivalent to Visual Studio Code’s keyboard shortcut
“Copy line (empty selection)”( ⌘ / Ctrl + C ) &
“Cut line (empty selection)”( ⌘ / Ctrl + X ).
If you assign shortcuts using Keyboard Maestro, AutoHotkey or similar,
you will be able to achieve more of a Visual Studio Code feel.
Both point and area types are supported.
For example, cutLine(emptySelection).js:

Usage
Move the cursor to the line you want to copy or cut, and run this script.
It is not necessary to select a line.
Linefeed are not included to work around a bug in Illustrator.
[!NOTE]
Area type with wrapping may not work well.
If you are using version 2020 or earlier, you will not be able to enter keyboard input after running the script.
If you want to enter text, you must click with the mouse.
Requirements
Illustrator CC 2018 or higher

This script creates a color chart. Both CMYK and RGB colors are supported.

Usage
- Run this script.
- Select CMYK or RGB mode.
- Enter the target color values.
If select a path or text object, its fill color value is used as the initial value.
- Select colors for the vertical and horizontal axis.
- Enter the increase or decrease value as a percentage.
- Select Addition or Intensity.
Addition The value of the steps is added as is.
Intensity The percentage of the target color is added. It is equivalent to Edit > Edit Colors > Saturate.

- Set the units, artboard size, and color chip size according to your preference.
[!NOTE]
Spot color, gradient, and pattern are not supported.
Create a color chart in a new document.
Requirements
Illustrator CS6 or higher

This script creates grid lines on artboards.

Usage
Just run this script.
Grid spacing is determined by the Guides & Grid in Preferences.
Requirements
Illustrator CS or higher

This script is equivalent to InDesign’s Type > Insert Special Character > Markers > Current Page Number.
Places a page number at a specified location on the artboards.

Usage
- Run this script.
- Set up each parameter in the dialog that appears.
Position Position of the page number relative to the artboard.
Facing Pages If true, the facing page.
Start Page Number A start page number.
Section Prefix Add a Section Prefix in front of the page number. If facing page, in back of the page number.
Font Size Font size of the page number.
Margin Distance from the artboard. Switch the units according to the ruler units.
[!NOTE]
The page numbering style is numeric only.
Assign page numbers in artboard order.
Requirements
Illustrator CS4 or higher

This script creates a text parallel to a straight segment or a line connecting two anchor points.

Usage
- Select two anchor points with the Direct Selection Tool, and run this script.
- Enter any text. The default values are the distance and angle between two points.
- Select either Point Type or Area Type.
Point Type Select left, center, or right align.
Area Type Enter area width and height values.
- Check the Flip checkbox reverses the drawing position.
- Check the Middle checkbox to draw in the middle of the path segment.
- Enter a value of the margin will space them from the path segment.
[!NOTE]
Curves are not supported.
Anchor points for type on a path and area type are also supported.
Support units
Point, Pixel, Pica, Inch, Feet, Yard, Millimeter, Centimeter, Meter.
These units depend on the ruler units.
Requirements
Illustrator 2021 or higher

This script creates a threaded text. It can also be made from a mixture of point types and path objects.
The vertical text is also supported.

Usage
- Select two or more text and/or path objects, and run this script. There is no need to convert to the area types in advance.
- Select an order of concatenation.
- Enter a value of the alignment position tolerance. (0 or higher number)

- To convert the paths to the texts, check the Convert Path to Type checkbox and select either the Area Type or Type on a Path.
[!NOTE]
The stacking order of objects and layers has no bearing on the order of concatenation.
When converting the path to the area type, ignore anchor points with fewer than two anchor points.
Support units
Point, Pixel, Pica, Inch, Feet, Yard, Millimeter, Centimeter, Meter.
These units depend on the ruler units.
Requirements
Illustrator CC or higher

This script decreases selected anchor points clockwise or counterclockwise.
For example, decreaseSelectedAnchorPointsCW.js:

Usage
Select any anchor points with Direct Selection Tool, and run this script.
Requirements
Illustrator CS or higher

This script is equivalent to Visual Studio Code’s keyboard shortcut
“Delete All Left”( ⌘ + Backspace ) &
“Delete All Right”( ⌘ + Delete ).
If you assign shortcuts using Keyboard Maestro, AutoHotkey or similar,
you will be able to achieve more of a Visual Studio Code feel.
Both point and area types are supported.
For example, deleteAllRight.js:

Usage
Move the cursor to the position of the character you want to delete and run this script.
It is not necessary to select a string to be deleted.
Since using copy and paste functions inside the script, it will lose if you have copied the content in advance.
[!NOTE]
Only one line can be deleted. Multiple lines are not supported.
If you are using version 2020 or earlier, you will not be able to enter keyboard input after running the script.
If you want to enter text, you must click with the mouse.
Requirements
Illustrator CC 2018 or higher

This script deletes all swatches except None and Registration.

Usage
Just run this script.
Delete any swatches in use for the objects as well.
Requirements
Illustrator CS or higher

This script deletes hidden layers.
It has been implement in the Layers panel menu since version 2021.

Usage
Just run this script.
Requirements
Illustrator CS or higher

This script deletes locked layers.

Usage
Just run this script.
Requirements
Illustrator CS or higher

This script deletes trailing spaces and tabs.
Both point and area types are supported.

Usage
Select the text objects, and run this script.
It is not necessary to select a line.
Area type with wrapping may not work well.
Requirements
Illustrator CS or higher

This script deletes unused layers.

Usage
Just run this script. It is not necessary to select any layers.
Requirements
Illustrator CS or higher

This script deletes a word under the cursor.
Both point and area types are supported.

Usage
Move the cursor to the position of the word you want to delete and run this script.
It is not necessary to select a word.
Since using copy and paste functions inside the script, it will lose if you have copied the content in advance.
[!NOTE]
Area type with wrapping may not work well.
If you are using version 2020 or earlier, you will not be able to enter keyboard input after running the script.
If you want to enter text, you must click with the mouse.
Requirements
Illustrator CC 2018 or higher

This script breaks apart the path object with anchor points.

Usage
Select any path objects, and run this script.
The original path object will deleted.
Requirements
Illustrator CS or higher

This script distributes objects evenly spaced in space.
For example, distributeInSpace(Vertical).js:

Usage
Select three or more objects, and run this script.
The position of alignment depends on the reference point.
[!NOTE]
Include or exclude the stroke width depends on the Align panel menu > Use Preview Bounds.
Select at least three objects.
Requirements
Illustrator CS3 or higher

This script draws a circumscribed circle through 3 or 2 anchor points.

Usage
Select 3 or 2 anchor points with Direct Selection Tool, and run this script.
[!NOTE]
For two anchor points, it is the diameter.
Anchor points for type on a path and area type are also supported.
Requirements
Illustrator CS or higher

This script draws normal lines (line perpendicular to a tangent) to a curve or line between two anchor points.

Usage
- Select two or more anchor points with the Direct Selection Tool, and run this script.
- Enter the number of normal lines to draw.
- Enter the length of normal line to draw.
- Check the Draw on Selected Anchor Points checkbox if you want to draw on the selected anchor points.
- Check the Flip checkbox reverses the drawing position.
- Check the Middle checkbox to draw in the middle of the path segment.
- Enter a value of the margin will space them from the path segment.
Anchor points for type on a path and area type are not supported.
Support units
Point, Pixel, Pica, Inch, Feet, Yard, Millimeter, Centimeter, Meter.
These units depend on the ruler units.
Requirements
Illustrator CS4 or higher

This script draws rectangles around selected objects.

Usage
- Select any objects, and run this script.
- Enter a margin value.
- To draw a rectangle on each object in the group, check the Ignore Groups checkbox.
- To include stroke width, check the Use Preview Bounds checkbox.
The rectangle is drawn with no fill and stroke width.
Support units
Point, Pixel, Pica, Inch, Feet, Yard, Millimeter, Centimeter, Meter.
These units depend on the ruler units.
Requirements
Illustrator CS4 or higher

This script draws an S-curve between two objects or converts an open path to an S-curve.

Usage
- Select two objects or one open path object, and run this script.
- To change the curvature, enter the bend in the text field or use the slider to set the value.
The slider allows only up to 200%, but you can enter higher values in the text field.
- To angle the S-curve, enter the angle in the text field or use the slider to set the value.
The angle is specified in degrees.
- Check the Opposite checkbox to draw the curve at the opposite side.
Requirements
Illustrator CS4 or higher

This script draws shapes on anchor points.

Usage
- Select any path objects, and run this script.
- Select a shape.
- Enter a shape size.
- If you select anchor points with the Direct Selection Tool, choose whether to draw the shape on all anchor points or only on the selected anchor points.
- Check the Draw Handle Position checkbox if you want to draw the shapes on the handle positions.
Support units
Point, Pixel, Pica, Inch, Feet, Yard, Millimeter, Centimeter, Meter.
These units depend on the ruler units.
Requirements
Illustrator CS4 or higher

This script draws a shape parallel to a straight segment or a line connecting two anchor points.

Usage
- Select two anchor points with the Direct Selection Tool, and run this script.
- Select a Square, Rectangle or Ellipse.
- If you select the Rectangle or Ellipse, enter width and height values.
- Check the Flip checkbox reverses the drawing position.
- Check the Middle checkbox to draw in the middle of the path segment.
- Enter a value of the margin will space them from the path segment.
[!NOTE]
Curves are not supported.
Anchor points for type on a path and area type are also supported.
Support units
Point, Pixel, Pica, Inch, Feet, Yard, Millimeter, Centimeter, Meter.
These units depend on the ruler units.
Requirements
Illustrator CS4 or higher

This script encloses words in parentheses.

Usage
Move the cursor to the position of the word you want to enclose and run this script.
If you select text ranges, enclose them.
Since using cut and paste functions inside the script, it will lose if you have copied the content in advance.
[!NOTE]
Area type with wrapping may not work well.
If you are using version 2020 or earlier, you will not be able to enter keyboard input after running the script.
If you want to enter text, you must click with the mouse.
If you want to enclose it with other characters, change lines 41 and 42 inside the script.
For example, if you enclose it in brackets:
var parentheses = {
start: '[',
end: ']'
};
Requirements
Illustrator CC 2018 or higher

This script exports multiple PDFs simultaneously from a single Adobe Illustrator document. Up to 5 presets can be selected.
You can also export open documents or all documents in a folder together.

Usage
- Open some documents to be exported to PDF, and run this script.
- Select some PDF presets.
- Enter the string to be added to the end of the file name. The default value is a serial number.
- If the document has multiple artboards, select whether the exported PDF should be a single or multiple file.
- Select the range of the artboards to export.
All All artboards to export.
Ranges Specifies the range of the artboards to export.
- You can specify the document to export to PDF with the following options.
Active Document Export only the currently displayed document to PDF.
All Open Documents Export all open documents to PDF.
All Documents in the Same Folder Checking the checkbox will export all documents in the same folder as the active or all open documents. No need to open all documents.
- To create an outline, check the Create Outline checkbox.
[!NOTE]
The PDF files export in the same folder as the Illustrator documents.
If the PDF file with the same name exists, it overwrites.
Requirements
Illustrator CS6 or higher

This script exports color values of a path object or swatches to a CSV file.

Usage
Select path objects or swatches, and run this script.
If you want to export all swatches, deselect path objects and swatches.
[!NOTE]
If you want to get the swatch name, use a global color.
Export to the desktop.
Prioritize the path object over swatches.
Text object and gradient are not supported.
Requirements
Illustrator CS or higher

This script extends and shrinks handles. It also changes the angle.

Usage
- Select one or two anchor points with the Direct Selection Tool, and run this script.
- Enter a positive value in the Distance fields to extend or a negative value to shrink.
- Enter a positive value in the Angle fields will rotate counterclockwise. Enter a negative value clockwise.
[!NOTE]
Handles cannot delete.
The angle increases or decreases based on the current value.
Support units
Point, Pixel, Pica, Inch, Feet, Yard, Millimeter, Centimeter, Meter.
These units depend on the ruler units.
Requirements
Illustrator CS4 or higher

This script extends and shrinks path segments.

Usage
- Select any anchor points with the Direct Selection Tool, and run this script.
- Enter a positive value to extend or a negative value to shrink.
[!NOTE]
Closed paths and curves are not supported.
Anchor points for type on a path are also supported.
Support units
Point, Pixel, Pica, Inch, Feet, Yard, Millimeter, Centimeter, Meter.
These units depend on the ruler units.
Requirements
Illustrator CS4 or higher

This script extracts colors as swatches from the gradient stops.

Usage
Select any path objects or swatches, and run this script.
[!NOTE]
Prioritize the path object over swatches.
To extract color from swatches, deselect the path objects.
Text object and stroke color are not supported.
Requirements
Illustrator CS or higher

This script fits guide objects in an artboard.

Usage
Select guide objects, and run this script.
Closed paths and curves are not supported.
Requirements
Illustrator CS or higher

This script changes the zoom factor that the selected object fills the display.

Usage
Select any objects, and run this script.
If no objects are selected, all objects should fit in the window. Ignore guides.
Requirements
Illustrator CS or higher

This script generates a gradient color from fill colors or swatches.
It has been implement in the Swatch panel menu since version 2025.

Usage
Select two or more path objects or swatches, and run this script.
[!NOTE]
Prioritize the path object over swatches.
To generate gradient color from swatches, deselect the path objects.
Text object and stroke color are not supported.
Requirements
Illustrator CS4 or higher

This script is equivalent to Visual Studio Code’s Go > Go to Line/Column( Ctrl + G ).
If you assign shortcuts using Keyboard Maestro, AutoHotkey or similar,
you will be able to achieve more of a Visual Studio Code feel.
Both point and area types are supported.

Usage
- Run this script in the text editing state.
- Enter a line number or select a line from the list below that you want to move.
Since using copy and paste functions inside the script, it will be lost if you have copied the content in advance.
[!NOTE]
Pan that the selected line is centered in the window.
If you are using version 2020 or earlier, you will not be able to enter keyboard input after running the script.
If you want to enter text, you must click with the mouse.
Requirements
Illustrator CC 2018 or higher

This script moves the cursor to the beginning of the next or previous text while in the text editing state.
Both point and area types are supported.
For example, goToNextText.js:

Usage
Run this script in the text editing state.
Since using cut and paste functions inside the script, it will lose if you have copied the content in advance.
[!NOTE]
It will not move to locked, hidden, or threaded texts. The layer also as well.
The cursor moving order is text stacking order.
Pan that the next or previous text is centered in the window.
If you are using version 2020 or earlier, you will not be able to enter keyboard input after running the script.
If you want to enter text, you must click with the mouse.
Requirements
Illustrator CC 2018 or higher

This script highlights the searched string by fill color, swatch or character style.
Both CMYK and RGB colors are supported.

Usage
- Select any text objects, and run this script.
If no texts are selected, it highlights all texts in the document.
- Enter a string. Regular expressions are supported.
- To specify a color, enter the color values or use the sliders
- To specify a swatch, select a swatch name from the list on the Swatches tab and check the Ignore Color Settings checkbox.
- To specify a character style, select a style name from the list on the Character Styles tab.
- To specify a paragraph style, select a style name from the list on the Paragraph Styles tab.
If you wish to color the character and paragraph styles, uncheck the Ignore Color Settings checkbox.
Color and swatch cannot be applied at the same time.
Requirements
Illustrator CS6 or higher

This script imports a CSV file to the Swatches panel.

Usage
- Run this script.
- Select a CSV file.
Make sure the document color mode and CSV file format are the same.
CSV files are available in the following 3 formats.
[!NOTE]
Commas or tabs separate columns.
Line 1 is used as the title.
The swatch name is not required.
For CMYK:
| Cyan |
Magenta |
Yellow |
Black |
Swatch name |
| 100 |
0 |
0 |
0 |
Cyan |
For RGB:
| Red |
Green |
Blue |
Swatch name |
| 255 |
0 |
0 |
Red |
For HEX:
| Hex |
Swatch name |
| FF0000 |
Red |
[!NOTE]
The leading “#” may be omitted in the case of Hex color.
If the Hex color is 3-digit, it behaves like CSS. (e.g. #F0F becomes #FF00FF.)
Requirements
Illustrator CS or higher

This script increases selected anchor points clockwise or counterclockwise.
For example, increaseSelectedAnchorPointsCW.js:

Usage
Select any anchor points with Direct Selection Tool, and run this script.
Requirements
Illustrator CS or higher

This script is equivalent to Visual Studio Code’s keyboard shortcut
“Insert Line Above”( ⌘ / Ctrl + Shift + Enter ) &
“Insert Line Below” ( ⌘ / Ctrl + Enter ).
If you assign shortcuts using Keyboard Maestro, AutoHotkey or similar,
you will be able to achieve more of a Visual Studio Code feel.
Both point and area types are supported.
For example, insertLineBelow.js:

Usage
Move the cursor to the line below or above you want to add a line, and run this script.
It is not necessary to move the cursor to the end of the line.
[!NOTE]
Area type with wrapping may not work well.
If you are using version 2020 or earlier, you will not be able to enter keyboard input after running the script.
If you want to enter text, you must click with the mouse.
Requirements
Illustrator CC 2018 or higher

This script inverts locked layers.

Usage
Just run this script.
Requirements
Illustrator CS or higher
[![Download Layer.zip](https://img.shields.io/badge/Download-Layer.zip-e60012?style=flat
README 内容过长,已截取前 64 KB。完整内容请前往 GitHub 仓库查看。
评论