Answered
Script to switch object color to another swatch
Hello guys,
I'm trying to put together the script which change color to another swatch color.
So for example in this case, it should change stroke color to green:

I have this, I tried to modify it in a couple of ways, but it still doesnt work:
var swatches = app.activeDocument.swatches;
for (i=0; i<app.selection.length; i++)
{
if (app.selection[i].swatches.index < app.swatches.length-1)
app.selection[i].swatches = app.swatches.nextItem(app.selection[i].swatches);
}
