Cleanup Scripts is my catch-all category for scripts which help to remove some of the tedium of various tidying-up chores, especially with artwork imported from other programs, such as CAD exports.

Link to zip archiveDownload The .zip Archive


JET_FixRegColorFromFH.jsx
When opening a FreeHand file, Illustrator fails to assign AI's [Registration] swatch to paths and text having FreeHand's Registration swatch. Instead, it imports FH's Registration swatch as a process swatch.

This script cycles through the characters in the document's textFrames looking for characters with a fillColor of "Registration" and assigns AI's [Registration] swatch to each one it finds. The script then does the same for pathItems, first looking for fills, then for strokes. Select the paths to be affected. Run the script. Enter the desired minimum segment length in the prompt.


JET_RemoveSegmentsShorterThan.jsx
Reduces the number of anchorpoints on selected paths, according to a minimum specified by the user. Removes from each selected PathItem, segments shorter than the measure entered by the user. Useful for certain types of path simplification and cleanup chores, as in imported DXF files.

Select the paths to be affected. Run the Script. Enter the desired minimum number of segments in the prompt.


JET_RemoveShortSegment.jsx
General path simplification. Allows the user to specify the minimum number of segments to be retained. This script removes the shortest segment from each selected PathItem that has more than the number of segments entered by the user.

Select the paths to be affected. Run the Script. Enter the desired minimum number of segments in the prompt.


JET_RemoveShortSegmentsUntil.jsx
General path simplification. Allows the user to specify the number of segments to be left for each path. This script repeatedly removes the shortest segment from each selected PathItem until the number of segments is no more than the number entered by the user.

Select the paths to be affected. Run the script. In the prompt, enter the desired number of segments to be left each path.