Skip to content

Scripts

Applescripts


For Adobe Illustrator

Close Open Paths

FREE! This JavaScript works with Adobe Illustrator for both Mac and Windows, to select and close all open paths. Expand the zip archive and place the .jsx file in your Scripts folder.

Close Open Paths (Mac/Windows)


FREE! This set of 31 scripts requires Mac Illustrator 2020 or 2021. Most work in CC and even CS6 as well. Some of the older scripts are now incorporated into the ToolShed plugin.

Download all AI 2020 scripts (Mac OS X)

Increment callouts

This is helpful for situations where you have a lot of point text callouts of sequential numbers, then that art gets revised to insert or remove some numbers. Just select the existing callouts you want changed, run the script, and answer the prompts for what direction to increment them (up or down) and what value to add or subtract.

Untransform text

Untransforms (removes all scaling, rotation, and shearing of) an embedded raster object.so you can export it, retaining the original pixel-for-pixel data. Place this file in your Illustrator folder, in the Presets folder, in the Scripts folder. It will then be available from Illustrator’s Scripts submenu in the File menu. Copy or drag the embedded image you want to export into a new, blank document. Select the object, then select “Untransform raster object” from the File/Scripts menu. You must export it at 72 dpi to avoid rerasterizing the image. For best results, export it using the same color model as the image you’re exporting. You can then open the exported file in Photoshop to change its resolution and/or resave as EPS with a preview.

Reapply char styles

When text is pasted from one document into another with different style definitions, run this script to conform to the document’s style definitions.

Redefine char styles from selection

Pasting text into a document adds any new character styles, but doesn’t update existing styles. Run this script with the new text selected to update the document styles to match the selection.

Find unstyled text

Selects all point text art which hasn’t had a character style applied. This is useful for when you want to apply a uniform named style to all text.

Rotate Text To

Rotates each selected point text object to a given number of degrees.

Concat Text (and several variations of this)

Select several point text objects, then run this script to combine each line of text into a single point text object. Objects are parsed in the order in which they were created in the document. Try the different variations, as they work in slightly different ways.

Untransform Text

Removes transformations from text objects, such as rotation and sheer. Select the entire text object with the arrow tool, then run the script.

Bust Up Paragraphs and Bust Up Words

Select text objects that contain multiple paragraphs, then run this script to break them up into individual point text objects, one object for each paragraph. I wrote this one to separate a text file full of callouts into indivudual pieces to position on an illustration.

Make Fraction

Selected text is changed to superscript numerator and subscript denominator, and the slash is changed to a fraction slash. Best with superscript and subscript size of 70%, superscript position of about 23% and subscript position of 0%.

Straighten Quotes

This is helpful for a list of callouts pasted from a word processor file where quotes should represent foot and inch marks.

Select same char style
Select same font and size
Select same font

These select text objects based on the properties of the first character of the selected sample text object.

Copy as list
Copy as comma delimited

These two scripts are useful for when you need to copy point text out of Illustrator to place on the clipboard for spreadsheets or other applications.

Select Schnibbles

Selects all paths that are no more than two points wide by two points high. Call this script with an object selected and that will become the maximum size for the selection.

Paths – close

Closes all selected open paths.

No Overprints

Removes overprint from the stroke and fill of selected paths. This is useful because changing it on multiple items via the Attributes palette doesn’t always work reliably.

Fix 4-color black

If you work in a CMYK environment and add art created in an RGB document, it prints in multiple colors and appears as a dark brown, and screened so it’s soft-edged and even worse when out of register. If text fill colors or path stroke colors of C, M, and Y are 60 or above, or R, G, and B values of 39 or above, the fill will be converted to grayscale black. You’ll be alerted when art has been changed.

Remove pixel alignment

This removes the align-to-pixel property that can sometimes get stuck to art objects.

Dot-dot

This is helpful for creating “connect the dots” puzzles. Create a symbol named “dot” and run this script with path art selected. A dot symbol will be placed at each anchor point and a sequential number added as path text. If you have defined a character style “dot number” that style will be applied to the number text.

apply BBAccumRotation

Gets the accumulated rotation of the topmost selected object, then applies it to all unselected art. This can be useful in conjunction with the Free Transform tool, which reads and write a tag with the accumulated rotations of the art.

Show-hide hidden layers

In my work, I define mark layers to be automatically hidden by setting the layer name to begin with a hyphen. Other layers to always hide at preflight time are “scan” and “proof block” so running this script as part of my green lighting process ensures that hidden reference layers don’t accidentally appear.

 


 

FREE! Requires Mac Illustrator 10 or CS (for those who still run such “classic” versions)

Download all scripts (Mac OS X)

Untransform raster object

Untransforms (removes all scaling, rotation, and shearing of) an embedded raster object.so you can export it, retaining the original pixel-for-pixel data. Place this file in your Illustrator folder, in the Presets folder, in the Scripts folder. It will then be available from Illustrator’s Scripts submenu in the File menu. Copy or drag the embedded image you want to export into a new, blank document. Select the object, then select “Untransform raster object” from the File/Scripts menu. You must export it at 72 dpi to avoid rerasterizing the image. For best results, export it using the same color model as the image you’re exporting. You can then open the exported file in Photoshop to change its resolution and/or resave as EPS with a preview.

Clean library

Removes bloated “AdobeFnt0__.lst files from your system (useful only to Illustrator 10 users on Mac OS X).

Scale line weight

Scales the stroke weight of selected, stroked paths.

Select Schnibbles

Selects all paths that are no more than two points wide by two points high.

Concat Text for AI 10 or CS

Select point text objects that were imported as multiple point text objects broken between or even within words, then run this script to combine each line of text into a single point text object. Objects are parsed in the order in which they were created in the document. If a text object is positioned lower than the previous one, it’s considered a new line, and a new point text object is created for it.

Concat Text Lines for AICS

Select several point text objects, then run this script to combine each line of text into a single point text object. Objects are parsed in the order in which they were created in the document. Unlike Concat Text, this script combines all objects into one, regardless of their position, and adds a space character between them.

Area Text to Point Text

Converts area text objects to point text objects. It’s pretty basic and doesn’t take into account rotated text, etc., but should get you out of a jam for most situations, such as callouts on technical drawings, etc.

Requires Illustrator CS (11).

Untransform Text

Removes transformations from text objects, such as rotation and sheer. Select the entire text object with the arrow tool, then run the script.

Requires Illustrator CS2 (12).

Bust Up Paragraphs

Select text objects that contain multiple paragraphs, then run this script to break them up into individual point text objects, one object for each paragraph. I wrote this one to separate a text file full of callouts into indivudual pieces to position on an illustration.

Requires Illustrator CS (11).

Make Fractions

Selected text is changed to superscript numerator and subscript denominator, and the slash is changed to a fraction slash. Best with superscript and subscript size of 70%, superscript position of about 23% and subscript position of 0%.

Requires Illustrator CS (11).

Open “Scripts” Folder

Just what it says: opens AI’s “Scripts” folder.

Requires Illustrator CS (11), but could be easily modified for AI 10.

No Overprints

Removes overprint from the stroke and fill of selected paths. This is useful because changing it on multiple items via the Attributes palette doesn’t work reliably.

Requires Illustrator CS (11), but could be easily modified for AI 10.

Replace placed art

Replaces all placed, linked art with the first selected placed, linked art. Say you have a sheet of many occurrences of a placed EPS file, and you need to revise the sheet to use a different placed file. Manually replace one of the objects with the new file, then with the new object selected, run this script. All unselected placed files will be replaced with the selected one.

You may also be interested in free Actions for Adobe Illustrator.

 


Scripts for Adobe InDesign CS

Download all scripts (Mac OS X)

No-Nonprinting

This script checks every graphic in an InDesign document and sets its “printable” property to true. Quark documents opened in InDesign often have numerous graphics that are incorrectly set to non-printing and this script makes all graphics printable.

Multi-Template scatter proof

Choose from a list of template files to create a scatter proof sheet of a folder full of images. Instructions and two sample templates are included in the archive.

Export to InCopy

Export all stories, not just those selected or on a certain layer, to InCopy except those marked not to export. More details are included in a read-me file in the archive.

Check out all stories

This is a counterpart to the “InCopy Stories/Check In All” menu item in InDesign. Change the application name in the first line of the script and it can also be used in InCopy.


This AppleScript is specifically for plugin developers using Hot Door’s CORE libraries for Adobe Illustrator plugin development.

generate resource IDs

Each image can have up to 20 variations with unique ID names, and used in at least four different places, which can become overwhelming when your project has more than a few images. This AppleScript generates text for cross-platform Hot Door CORE resource definition files as used in CORE 0.7.6 and earlier:

• ResourceIDs.rh
• Resources.r
• Resources.rc
• IDtoFile.txt

To be honest, I find the scripted JSON system used in CORE 0.7.7 to be more complicated than just hand coding it, so I’ll share this script I wrote to help for my work. To use the script, select one or more image files (either PNG or SVG) representing a base image file. 

By “base” I mean the 1x size, light UI, not rollover. Next, run the script and answer the dialogs. The script relies on your having followed the file naming conventions of the Hot Door CORE samples, which you can also see in the results for the IDToFile.txt file. Optionally, you can run it with nothing selected in the Finder and just provide a base image file name when prompted.

Either way, you’ll be prompted to specify which image sizes you’re using (1x, 1.5x, 2x, 3x, and/or 4x), and whether it should include rollover images. For resource names and numbers, you’ll be prompted for a prefix (e.g., “TS” in the CORE Tool sample) and starting resource number.

The script will generate the resource definitions and place the results in a TextEdit window, which you can cut and paste into your CORE Xcode project files.

No guarantees it’s 100% reliable, but it should save a ton of time compared to writing this all out by hand.

If you find a problem, just let me know and I’ll do my best to update the script