Answered
Change Multiple Offset Stroke Color Gradually

I'm trying to add multiple strokes gradually with offset decreament from black to white or vice versa on appearance menu. Years ago thanks to Qwertyfly he had written a great script as above,
#target illustrator
//-------------------------------------------------------------------
// Offset Path in apperence panel
// Script by Qwertyfly
// contact tristan@qwertyfly.com
// version 0.1 beta
//-------------------------------------------------------------------
var doc = app.activeDocument;
mySelection = app.activeDocument.selection;
//number of offset paths
var Qty = 20;
//amount to offset -
var Offset = -1;
var round = 1;
//units to offest in
var Unit = "pt";
//time to wait in milliseconds before sending keys.
// more time is slower but more stable
// I was able to run this with it set to 0, but a little bit of a pause is a good idea.
var wait = 10;
//-------------------------------------------------------------------
function FillDialog_Windows(distance){
var VB = [
'WScript.Sleep ' + wait + '',
'Set WshShell = WScript.CreateObject("WScript.Shell")',
'WshShell.SendKeys "' + distance + '"',
'WshShell.SendKeys "{TAB}"' ,
'WshShell.SendKeys "{DOWN}"' ,
'WshShell.SendKeys "{TAB}"' ,
'WshShell.SendKeys "1"',
'WshShell.SendKeys "{ENTER}"'
].join('\n');
var VBgo = new File('~/go.vbs');
VBgo.open('w');
VBgo.write(VB);
VBgo.close();
VBgo.execute();
}
function MakeStroke(offset){
app.executeMenuCommand('Adobe New Stroke Shortcut');
FillDialog_Windows(offset);
app.executeMenuCommand('Live Offset Path');
}
var color1 = new CMYKColor();
color1.cyan = 0;
color1.magenta = 0;
color1.yellow = 0;
color1.black = 0;
for(var i = 1; i<Qty+1; i++){
MakeStroke(i*Offset + Unit);
//doc.pathItems[i].strokeColor = color1;
//doc.strokeColor = [color1.cyan,color1.magenta,color1.yellow,color1.black+10];
} Now I would like to change each stroke color gradually from black to white. But I cannot access the stroke. Could anyone please help me?
Thank you.
