Work

Fun Stuff

Other Stuff

Click here to contact me!

JS4AI logo JS4AI

John's Scripts  4  Adobe Illustrator @JS4AI on twitter


The Scripts (36 total):

   Add Highlight And Shadow Swatches v.1 :: CS, CS2
To download this script: right-click and select "Save Link As"

A simple script for Animators. Takes current fill color from color pallate.
a prompt will ask you to name the color, then it adds it to the swatch palate,
along with the highlight and shadow for that color.

feel free to tweak the values to get whatever percentages work best for you.


back to the script index (top of page)
 

   Align Ungrouped Textfields to Center (Without Shifting Text) v.1 :: CS
To download this script: right-click and select "Save Link As"

When a user clicks the "Align" buttons on the Paragraph tab,
Illustrator shifts the text visually from it's original position.

I wanted to be able to quickly change the paragraph alignment to center
without having to reposition the text.

Here's the script to do it.

At the top of the code is a list of acceptable variables to substitute if you
want to adapt the script to always justify to some other alignment than center.

back to the script index (top of page)
 

   All Points v.1.3 :: CS,CS2,CS3,CS4
To download this script: right-click and select "Save Link As"

This script simply draws a line from every point to every other point of your selected pathitem.
Handy for making Mandalas. Try on polygons, stars or even freehand shapes.

back to the script index (top of page)
 

   Arc Twister v2.0 :: CS, CS2, CS3, CS4
To download this script: right-click and select "Save Link As"


This script will twist an objects selected control handles
by the same amounts.

Current tweakable options are:
1) Left handles only
2) Right handles only
3) Mirror Angles (i.e.; rotates left handle x deg, right handle -x deg.)
4) Rotate Angles (Fixed relative to each other)
5) Change angles to Smooth (180 deg) and rotate.

Please Note:
I've created 3 interfaces for this script, and this is the most flexible and functional.
The first was using a kludgy basic 'prompt' dialog,
The second version used a swf interface that was slick, but encountered various issues during install.
This version uses Adobes JXS UI tools, so you get a dialog widget that is both easy to use, and works.
If you're using pre CS2, this script will gracefully fall back on the "prompt" interface.



back to the script index (top of page)
 

   CMYK to Pantone v.2 :: CS, CS2
To download this script: right-click and select "Save Link As"

this script compares the color values of a selected CMYK object to
the imbedded list of PMS Solid colors, and returns the closest match(es)

Matching is based on cumulative (C+M+Y+K) values, so the PMS color with the
least total color divergence is always chosen.
If colors are equally divergent, multiple matches will be displayed.

If no object is selected, or if the wrong type of object is selected,
user is prompted to manually enter CMYK values.

as of V.2 RGB colors are also accepted.

back to the script index (top of page)
 

   Copy to Object(s) v4.5 :: CS,CS2
To download this script: right-click and select "Save Link As"

User selects two (or more) objects:
This script copies the top most object to the position and size of
all other selected objects.

Version 2 update: Now adjusts stroke based on difference in area.
Version 3 update: Now accepts multiple targets.
-- thanks to an awesome hack by Iain Henderson (iain@addition.com.au)
Version 4 update: Deselects everything but source object
--this makes it easy to delete the source object if you wish,
-- also this makes the older "Replace-Object" script obsolete.
-- now allows user to choose whether to resize to target. (copies are centered to target.)

back to the script index (top of page)
 

   Copy to Single Object :: 10,CS,CS2
To download this script: right-click and select "Save Link As"

User selects two (or more) objects:
this script copies the top-most object to the position
and size of the second object.

Version 2 update: now adjusts stroke based on difference in area.
This script is mostly made obsolete by "copy to multiple objects"
This version is kept for primarily for posterity,
and for use on systems that won't run the "multiple copy" script.


back to the script index (top of page)
 

   Delete Unused Assets (fluff) v.2 :: CS, CS2
To download this script: right-click and select "Save Link As"

Code is loosely based on a VB script from
Adobe Illustrator Scripting by Ethan Wilde
-------------------------------------------------------
This script does the following:
1) removes unused swatches.
2) removes unused symbols.
3) removes ALL styles:
There is no way to check if a style is applied,
but this is not critical to me because the styled object
will not loose it's appearance, and the style can be re-added
if necessary by just dragging a 'styled' object back to the styles pallate.

This script does NOT do the following:
1) remove brushes:
The Javascript support just isn't there.

As of version 2:
You can set two variables at the top of the script to
delete the "NoColor" and/or the "Registration" swatches.
They are ignored by default.

THIS SCRIPT HAS BEEN RENDERED 99% OBSOLETE
BY THE "DELETE FLUFF" ACTION

which can be found in the "default.aia" file (included with illustrator),
or you can downloaded the action separately HERE


back to the script index (top of page)
 

   Distribute Stacked Objects v1.1(and Center them too.) :: CS,CS5
To download this script: right-click and select "Save Link As"

So you just imported 20 eps files and illustrator stacks them on top of each other.
You want to see them spread out a bit? Run this script.

This script distributes and centers all selected objects.
Each object's position is determined by it's stacking order in the layer palette.
To adjust an objects position in the layout,
manually move the object's stacking order in the layer palette.
The top object (in the layer) is always placed first.

When the script is run, a prompt appears,
and the user can define a custom padding value for spacing the grid.
The script then auto-distributes objects, and centers them on the page.

This script was designed for creating artboards and for easy viewing
of a stack of imported artwork, but it should work with everything.

v1.1:Fixed a bug that crashed the script.

back to the script index (top of page)
 

   Divide TextFrame v.2.2 :: CS and up
To download this script: right-click and select "Save Link As"

Divides a multiline text field into separate textFrame objects.
Basically, each line in the selected text object
becomes it's own textFrame. Vertical Spacing of each new line is based on leading.

This is the opposite of my "Join TextFrames" scripts which
takes multiple lines and stitchs them back together into the same object.
New in 2.1 now right and center justification is kept.
New in 2.2 better error checking, and now will run on more than one text frame at a time.

back to the script index (top of page)
 

   The Document Object Model Explorer v.2 :: CS
To download this script: right-click and select "Save Link As"


Select an object on the page, then run this script.
It will return a list of everything that object contains.
You can also manually explore the document object model by entering an object's path.

As of version 2, a "displayErrors" variable has been added.
Now users can view objects that failed.
"displayErrors" defaults to true, but can be turned off by
setting it to "0" in the first line of the script.

Output is also now alphabetized, and is broken into multiple alerts if output is
longer than the "maxLines" variable.

Prompt can now be used as a javascript command line too.
If user input returns a value, the value is returned in an alert box.

back to the script index (top of page)
 

   Batch Export Unlocked Layers v2 :: CS5
To download this script: right-click and select "Save Link As"

This script will generate a separate raster image for every UNLOCKED layer in your .ai file.

Locked images will be left as is.
To hide any layer;
Lock it, and hide it on the Layers palate before running this script.

To include a layer in every image:
Lock it, and make sure it's visible before running this script.

This script auto-generates a production script into the image export directory,
so if you ever need to re-run the script, just re-open all the same source files,
double click the .jsx file in your image export directory, and it will re-export
all the images with the same settings.
MUCH thanks to Chris Gebab for help brainstorming
a hack to get this working as a palette in illustrator.
For more info, see my blog
update: v2 adds ability to scale the exported images.

back to the script index (top of page)
 

   Extrude Faces v.1.0.0.0 :: CS2, CS3, CS4
To download this script: right-click and select "Save Link As"

Select any face or group of faces on a pathItem,
and this script will duplicate the anchor points on either side of the selected anchors,
allowing you then manually extrude the selection from the object.


back to the script index (top of page)
 

   Fleurify :: CS,CS2,CS3
To download this script: right-click and select "Save Link As"

Named after the "Fleur de Lis" as in "flower",
this script is the bastard love child of a Spirograph and the "Punk & Bloat" filter.

Enter a percentage to "fleurify" and the script turns basic geometry into flowery shapes.
Warning: the fleurified objects paths will self intersect. This shouldn't matter in print media, but
for cutable shapes you'll have to use the pathfinder palate to break and merge it.

Note: The anchors are never modified, only the control handles,
so you can always "un-fleurify" an object using my "sharpen corners" script.

back to the script index (top of page)
 

   Fractalize v.2.0.0.0 :: CS, CS2, CS3, CS4
To download this script: right-click and select "Save Link As"


Makes pretty fractal designs. Duplicates a Path Item for each point of the source object,
Then repeats the process for each new object, then repeats...etc.
Each iteration is slightly more transparent than the last.
User can choose to abort the process after each iteration.

Original object transform code by John Kelly, UI co-developed by J. Kelly and J. Wundes.

v 2.0 Now includes a single panel dialog for all variables, if using CS3 or above.
Script degrades gracefully, and should now work for CS and CS2 as well...


back to the script index (top of page)
 

   Group Overlapping (Beta) :: CS, CS2, CS3
To download this script: right-click and select "Save Link As"


Groups all overlapping objects in selection into discreet groups.
The definition for 'overlaping' is based on objects bounding boxes, not their actual geometry.
Each new groups zOrder is determined by the depth of the front-most object in each group.
There is no limit to the number of groups created.
Any non-overlapping objects are ignored.

Note: Currently, this is not very efficient code. It works well on small groups (less than 120 objects)
and works faster on smaller groupings. Running this on a huge number of objects will likely crash illustrator.
It serves my purposes, but test it's limits on your machine, and use at your own risk.
On a 2.53GHz P4, a group of 100 objects took 20 seconds with 2 groups.



back to the script index (top of page)
 

   Join TextFrames v.2.1 :: CS,CS2
To download this script: right-click and select "Save Link As"

When Adobe came out with the new CS text engine,
the text fields in documents saved in an older format were
often broken into "sub" fields.

This script is a rudimentary tool to help
rejoin the broken text fields. It works best on individual lines of horizontal text.

It collects text from any number of selected (non-grouped) textframes
and aggrigates them into a single text frame.
the order is based on relative x,y coordinates.

If a selected text anchors vertical coordinate is the same as the next one,
text areas are assumed to be on the same line.

If a selected text anchors vertical coordinate is different,
the text areas are assumed to be sequential lines,


This script WILL NOT make any attempt to maintain visual integrety of
character placement. It will only join the fields for easier editing,
but sometimes, just this little bit is a HUGE time saver.

As of Version 2.0 an option is given to maintain the individual styling of each letter.
See first lines of the script for details.


the sensitivity of what is considered "the same line" can
be adjusted by setting the "verticalTolerance" variable
near the top of the script (just below the style arrays).
but please note, it is assumed that all selected text is on a horizontal plane.
If you wish to join rotated textfields, you will have to unrotate them first.


back to the script index (top of page)
 

   Organify 2.0 :: CS, CS2
To download this script: right-click and select "Save Link As"

Randomizes all selected anchors by a selected number of points.

Enter small numbers to make objects look hand drawn.
Enter larger numbers to make objects look organic.
Enter even larger numbers to distort beyond recognition.

V.2 now offers a choice for randomizing 'Anchors Only', 'Control Handles Only' or both.
(click here to view sample image.)

back to the script index (top of page)
 

   organize v1.4 :: CS,CS2,CS3,CS4,CS5
To download this script: right-click and select "Save Link As"

A quick way to sort selected items by a given attribute.
For example, use this script to arrange items from left to right based on their height.
Another example is to change a group of items z-order position based on volumetric area.
More complexly, you can re-assign height based on x position.
Items can be sorted on (h)eight, (w)idth, (a)rea, (x)-axis, (y)-axis, (o)pacity, (z)-order)
Sort directions are small-to-large, large-to-small, and random.
Use most effectively in combination with the align palette to redistribute objects in new
powerful ways.

v1.1: changed wording for clarity,
added option to keep existing values, vs. align evenly.
and fixed prompt values displaying correctly. (thanks Egor)
v1.2: Fixed inconsistant spacing issue with autoAlign option
v 1.3: added a shortcut option in the first prompt.
v 1.4: Much better error handling.

back to the script index (top of page)
 

   Align to Pixels v.1 :: CS, CS5
To download this script: right-click and select "Save Link As"

A super simple script that aligns all selected objects to nearest pixel values.
Note: This is version 1, so please check to see if it works.
I had some problems with stroked objects.
v. 1.1 added check for height and width so script can work on line objects.

back to the script index (top of page)
 

   RandomEyes v.1.0.0.3 :: CS2, CS3, CS4
To download this script: right-click and select "Save Link As"


"Gimmie an Eye!"
Sometimes you just need eyes, so this script generates random critter eyes.

There are no manual settings for this script.
Just run it, and you get a pair of eyes.
The colors of the irises are pulled from the swatches palate.
Eye variations are randomized within predefined tolerances.
If a single pathItem is selected, that object will be used as the source structure for the eye shape.

Each eye is grouped, and both eyes are grouped together.
If you don't like the output, just make another set until you find something you like.


back to the script index (top of page)
 

   Render Swatch Legend v1.1 :: CS, CS2, CS3, CS4, CS5
To download this script: right-click and select "Save Link As"


This script will generate a legend of rectangles for every swatch in the main swatches palette.
You can configure spacing and value display by configuring the variables at the top
of the script.
update: v1.1 now tests color brightness and renders a white label if the color is dark.

back to the script index (top of page)
 

   Save file with timestamp v.3 :: CS, CS2
To download this script: right-click and select "Save Link As"

renames the current open file.
Saves file, closes and re-opens the file with new name.

back to the script index (top of page)
 

   Create Scallop Template :: CS, CS2
To download this script: right-click and select "Save Link As"

Run script on selected object, then select both the object and the new scallop template
then use Illustrators "subtract from shape area" transform to cut out the scallop.
Works on all shapes, and even on sub-selected points of an object.

currently version only works on single non-compound objects.
v2 now allows you to choose between drawing a circle around ALL anchor points or just around corner anchors.

back to the script index (top of page)
 

   Select Paths By Size v.4.1.1.0 :: CS, CS2, CS3,CS4 (Change extension from 'jsx' to 'js' to run in CS)
To download this script: right-click and select "Save Link As"

Selects all Path Objects, smaller/larger than given threshold
Only works for path and compound path objects.

If paths are selected, script runs on selected items only,
If nothing is selected, script runs on all paths in document.
::: Updates in V2 :::
• Rebuilt to select based on Size, Area, Width or by Height.
• Added "same size as" option
• If one object is selected, starts threshold at that size.
• Added Tool Tips
::: Updates in V3 :::
• Added status indicator
• Rebuilt processing engine so it's faster and more accurate
::: Updates in V4 :::
• Added progress bar (CS3 and above)
• Speed increase
::: Update v4.1 :::
• Select by stroke weight (patched in 4.1.1)

back to the script index (top of page)
 

   Select Replicated (Overlaping) Text Items v.1 :: CS,CS2
To download this script: right-click and select "Save Link As"

This script removes all duplicate overlaping text items from a document.
The ONLY parameters it checks are top and left coordinates, and text contents.
Anchor points within one point of each other are considered the same.
(tolerance can be adjusted by changing the 'tolerance' value.)

The lower duplicate objects are selected for manual removal.


back to the script index (top of page)
 

   Select Text by size v.1,01 :: CS,CS5
To download this script: right-click and select "Save Link As"

Script prompts user for a text size (in pixels),
and selects all text items in document at chosen pixel size.
Note: script also unlocks and unhides all instances of chosen text size.
change variables at top of script if your use case requires ignoring certain cases.
Updated to allow selection of a size range such as 5,9 for selecting all text between 5 points and 9.
Selection would include text at both 5 and 9 point sizes.

back to the script index (top of page)
 

   Set All The Things v.1.2 :: CS,CS2,CS3,CS4
To download this script: right-click and select "Save Link As"

Wanna Batch Transform objects? Illustrator has built in tools to resize each selected item,
but only by percentage, not by hard values. I made this script because I could find no
native way to set the width of all selected objects to 100px at once.

This script can accept multiple parameters at once.
To change, for instance, both width and height at the same time,
at the 'attributes' prompt, enter width,height
then at the 'values' prompt, enter a comma separated value list like 20,30
If a single value is passed for 'values', that value will be applied to all chosen properties.

Common legal parameter names include, but are not limited to: width,height,top,left.
Install and use explore.js on an object to see what other properties can be set.

Update: Based on feedback from user Jode, You are now given the option to transform objects from center.
You can now also use whatever standard units you like and the script will convert them into pixels.
e.g., you can enter "30mm" or "12in" and the script will know what you mean.
v1.2 adds decimal support and explicit 'px' and 'pt' units to the regex. (thanks to Cristofer Cruz for noticing the bug)

back to the script index (top of page)
 

   Sharpen Corners :: CS,CS2
To download this script: right-click and select "Save Link As"


Removes control handles from selected path points.
Works same as clicking a point with the convert anchor point tool,
but enmass on all selected points.

An option is provided for zeroing the control handles of adjacent points.



back to the script index (top of page)
 

   Resize by Luminance v.1.0.0.0 ::
To download this script: right-click and select "Save Link As"


Resizes all selected objects to a percentage of the objects original size
new size is based on the relative brightness of the objects fillColor.

aka: Make Halftones in Illustrator!!!

Designed to be used with mosaics generated from
embedded images.
Good tutorial on making Mosaics here
Further explanation on my blog

back to the script index (top of page)
 

   Swap Objects :: CS
To download this script: right-click and select "Save Link As"

User selects two objects:
this script swaps position and size of the two objects.

Version 2 update: now adjusts stroke based on difference in area.

back to the script index (top of page)
 

   Text Tweaker v2.0 :: CS, CS2
To download this script: right-click and select "Save Link As"


This script randomly tweaks each letter in all selected text fields.
Text lines remain unbroken, and text remains editable.

Current tweakable attributes are:
1) baselineShift
2) horizontalScale
3) verticalScale
4) rotation
5) size
6) strokeWeight
7) tracking
8) leading

New in version 1.1
Select a linear range to scale text smoothly from 10 to 50.
New in version 2.0
smoother transitions between states, and basic (bow and spike) envelope shapes.
random setting is now set between start and end values rather than from 0
uses cubic easing for all (non random) transforms


back to the script index (top of page)
 

   TileWrapper :: CS
To download this script: right-click and select "Save Link As"


This script creates and exports seamless JPG or PNG tiles.
It's purpose is to help generate quick seamless tiled backgrounds for web pages.
To use this script: create a crop area,
( Object>Crop Area>Make )
and draw some objects within it.
IMPORTANT: Overlap objects to the BOTTOM and the RIGHT side of the crop area only.
Objects that extend beyond the top or the left of the crop area will be ignored.

To create a tile:
select all items in the crop area, and run the script.
This will copy all objects that overlap the bottom and right crop
areas to the opposite side of the crop area, creating a perfect tile.

To Export as JPG:
Re-run the script with nothing selected. The script will ask for a destination.
Export options are JPG or PNG.

Notes: Objects are copied to the bottom of the same layer as it's source object.
This is so the user can create multiple tiles on other layers without problems.



back to the script index (top of page)
 

   to100pct v.1.0 :: CS,CS2,CS3,CS4,CS5
To download this script: right-click and select "Save Link As"

Addresses an issue when images are pasted from the clipboard at 70%
This script resets the matrix values for pasted RasterItems so they display at 100%.
Multiple raster items can be transformed at the same time, group items will be introspected, only raster items are affected.

back to the script index (top of page)
 

   Vary Hues / Randomize Colors v1.2 :: CS, CS2, CS5
To download this script: right-click and select "Save Link As"

This script is designed to create color variations such as seen in brick walls, or stone walkways.

When one or more objects are selected,
the script provides a prompt to the user with the following three options:

To vary the object(s) fill colors, enter a number from 0 to 100. 100 is maximum.
To vary the object(s) strokes, add an 's' after the number like this: 42s

The last option is slightly different, instead of entering a number for the variance,
the user enters an opacity range.
To vary the object(s) transparencies enter two comma separated numbers
representing the minimum and maximum like this: 23,44

Since the color values of spot colors by definition cannot be adjusted, the tint is randomized instead.
Gradients and Patterns are not affected.
Masked, or symbol objects are generally ignored.
Update now processes groups and compound path items.
added alert for wrong colorspace.

back to the script index (top of page)
 

   Zoom and Center to Selection v2. :: CS, CS2
To download this script: right-click and select "Save Link As"


Zooms active view to selected object(s).

New in v.2:
If nothing is selected; sets view to 100% at current location.

Simple but REALLY cool!


back to the script index (top of page)