Suppose I have an object filled with a linear gradient. This object is the only selected. I just would like to change the angle of the gradient to 25 degrees. So I think I could do:
var doc = app.activeDocument
alert(doc.selection.fillColor.angle) // the result is the exact angle of the gradient fill of the selected object. Suppose 12 degrees.
//now the try to change:
doc.selection.fillColor.angle = 25.0
No errors are found by the Extended Script Toolkit..BUT...it does not change anything. As Illustrator reference manual does not say this property is read only, I think I could write.
Am I missing anything?
Thank you a lot for the help
// GradientBlackWhite_rotated.jsx // requires an open document and one selected object var newGradient = app.activeDocument.gradients.add(); var colorOfGradient = new GradientColor(); var myGradientAngle = 80; colorOfGradient.gradient = newGradient; doc.selection.fillColor = colorOfGradient; /*Thanx to John Wundes for this -->*/doc.selection.rotate(myGradientAngle, false, false, true, false, Transformation.CENTER); redraw(); alert("gedreht");
Thank you for the tip.
Will adapt this code to my needs
Thank you a lot