Chris,
I think you will find that the script above does indeed change any spot color Swatch to CMYK process.
However, it does not change to CMYK process the colors of artwork on the page to which the spot colors were applied.
Well, sort of. Follow these steps carefully and exactly:
1. Create a document with a a spot color Swatch. Name the Swatch MySpotColor.
2. Rectangle tool: Draw a rectangle. Fill it with the spot color Swatch. Leave the rectangle selected.
3. Open the Color Palette. Note that the palette shows the single tint slider, the Spot Color indicator, and the CMYK indicator. The name of the Swatch is shown under the tint slider.
4. Mouse over (but do not click) the Spot Color indicator. Note that the tooltip reads "Spot Color (Click to convert)". If you click the indicator (don't), the object's fill would be changed to a process fill.
5. Run the script. The spot color Swatch becomes CMYK process. Look at the Swatches Palette. Note that the MySpotColor Swatch is not highlighted, even though the rectangle is still selected, and even though Spot Colors are always Global, and Global Colors, by definition, are supposed to update changes to objects to which they have been applied.
Look at the Color Palette. Note that the Spot Color indicator is gone, and has been replaced with the Global Swatch indicator. However, also note that only the single tint slider is shown, which would indicate that the color of the rectangle is still a Spot Color. In fact, if you now print the page to PDF as separations, you will see that you still get a Spot Color plate. Also note that the name of the former Spot Color Swatch is gone. There is no name at all.
However, mouse over (don't click) the Global Swatch indicator, and note that the tooltip reads "Process Color (Click to Convert)".
6. Drag that color swatch from the Color Palette and drop it in the Swatches Palette. Note that a process (not spot) Swatch is created. Note that the new Swatch is not highlighted, despite the fact the rectangle is still selected, and the color (according to the Color Palette) is supposed to be Global.
7. From the Color Palette's flyout menu, select "Create New Swatch". Note that the New Swatch dialog wants to create a Spot Color swatch, and its name is "MySpotColor 2".
8. Click OK. Note that the new Swatch is created and is highlighted, and that the Color Palette now shows MySpotColor 2 under the tint slider.
What's going on here? Well, at first blush, it appears that when changing a color from spot to process via Javascript, Illustrator does not abide by the change regarding what is supposed to be the definition of a Global Swatch.
But I think it's more. I strongly suspect this is a bug; and another manifestation of the similar issue I noted in
this post regarding apparent confusion on AI Javascript's part about what spot colors are as opposed to global colors. (Do a search for "global" in the AICS3 Javascript Reference, and you'll find no reference to global swatches.)
I think either AI's Javascript is screwed up here, or Illustrator is, or they both are.
I have always thought that AI's whole "Global Swatch" scheme is screwed up. All Swatches should be what AI calls "global".
JET