Sharing some simple JSX scripts to rename and modify swatches.
I created a few scripts to work with swatches since I couldn't find any, so I'm paying it forward! They aren't really complex or anything. Just very simple scripts, but useful (to me at least). I'm offering them up to the community to use as you see fit.:
- VSYS Swatches Prefix.jsx
- VSYS Swatches Remove First Word.jsx
- VSYS Swatches Remove Word.jsx
- VSYS Swatches Rename Serialize 2Pad.jsx
- VSYS Swatches Rename Serialize NoPad.jsx
You can download them all here: https://github.com/visusys/Illustrator-Swatch-Scripts
I would be overjoyed if other scripters contributed additional scripts as well to expand on this! I plan on creating a CEP plugin that includes all of this functionality into one panel. But I'm very new to CEP so this won't be happening any time soon.
Anyway here are some short descriptions of what each script does:
VSYS Swatches Prefix
This script will prefix selected swatch names with whatever you enter in the dialog.
For Example:
Blue
Red
Green
YellowBecomes:
Alert Blue
Alert Red
Alert Green
Alert Yellow
(With "Alert " entered in the popup window)
VSYS Swatches Remove First Word
This script will remove the first word from the selected swatches names.
For Example:
Carbon Blue
Carbon Red
Carbon Green
Carbon GreyBecomes:
Blue
Red
Green
Grey
(With "Carbon " entered in the dialog)
VSYS Swatches Remove Word
This script will remove a word (that you enter in a dialog) from the selected swatches names.
For Example:
Carbon Blue
Primary Carbon OffWhite
Green Carbon
Carbon Dark GreyBecomes:
Blue
Primary OffWhite
Green
Dark Grey
With "Carbon " entered into the dialog.
VSYS Swatches Rename Serialize NoPad
This script will completely delete the selected swatches' names and replace it with a custom base name, and then number them.
For example:
Red Swatch
Red2
Burning Red
Some other swatchBecomes:
Red Swatches 1
Red Swatches 2
Red Swatches 3
Red Swatches 4
(With "Red Swatches " entered into the dialog when the script is run)
VSYS Swatches Rename Serialize 2Pad
This script is exactly the same as VSYS Swatches Rename Serialize NoPad but pads the numbers to two figures.
For Example:
Red Swatch
Red2
Burning Red
Some other swatchBecomes:
Red Swatches 01
Red Swatches 02
Red Swatches 03
Red Swatches 04
(With "Red Swatches " entered into the dialog when the script is run)
Again, everything is here: https://github.com/visusys/Illustrator-Swatch-Scripts
Here are individual links:
https://github.com/visusys/Illustrator-Swatch-Scripts/blob/main/VSYS%20Swatches%20Prefix.jsx
https://github.com/visusys/Illustrator-Swatch-Scripts/blob/main/VSYS%20Swatches%20Remove%20First%20Word.jsx
https://github.com/visusys/Illustrator-Swatch-Scripts/blob/main/VSYS%20Swatches%20Remove%20Word.jsx
https://github.com/visusys/Illustrator-Swatch-Scripts/blob/main/VSYS%20Swatches%20Rename%20Serialize%202Pad.jsx
https://github.com/visusys/Illustrator-Swatch-Scripts/blob/main/VSYS%20Swatches%20Rename%20Serialize%20NoPad.jsx
Hope all of you wonderful people find these useful!
Jay
