I have converted some text to a groupItem using createOutline(), and now I am trying to apply a gradient to the converted text. My attempt to iterate through the pathItems in the groupItem resulted in an invalid object error on the loop line:
nametext.selected = true;
nametext.createOutline();
for(i = 0; i < nametext.pathItems.length; i++){
nametext.pathItems[i].filled = true;
nametext.pathItems[i].fillColor = colorOfGradient;
}
So I tried this instead, but the gradient was not applied:
nametext.selected = true;
var nameObj = nametext.createOutline();
for(i = 0; i < nameObj.pathItems.length; i++){
nameObj.pathItems[i].filled = true;
nameObj.pathItems[i].fillColor = colorOfGradient;
}
What am I doing wrong?
Thanks!