My first love in digital art was Deluxe Paint, way back in the late 80s and early 90s. The way it exposed the Amiga’s color model really shaped a lot of the way I still work; being able to tweak a “global” color swatch in Illustrator and have everything I drew in that swatch immediately change, the same way tweaking a palette register in DPaint worked, was the deciding factor in me choosing Illustrator over Painter or Photoshop when I switched to a Mac.
Lately I’ve been experimenting with returning to these roots in the way I manage my colors. A common workflow in DPaint was to pick a couple of colors at widely-spread points on the palette, then make DPaint fill in all the intervening palette registers with a smooth gradient between them. I’ve been simulating this workflow by making a couple of global swatches, then drawing a couple of boxes, using Illustrator’s blend tool to generate a series of shapes that have a color gradient, and eyedroppering all of those colors into the palette, then setting them to global swatches. But obviously that is a lot more steps than “select two colors, hit a button”. So I spent an hour and a half doing some scripting…
As the video notes, it only works on global CMYK swatches. If you work in RGB or spot swatches, you’ll have to tweak this some.
Download Blend Swatches.jsx and stick it in the presets/your_language/scripts directory, then invoke it with file->scripts, and enjoy. (You’ll have to quit and relaunch AI if it’s running before the script shows up in that menu.)