Adobe 26001360 Scripting Guide - Page 114
Notes, Example 16.1, object represents a point on a specific gradient defined in
UPC - 718659321840
View all Adobe 26001360 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 114 highlights
114 AppleScript Reference Notes Illustrator's gradient stop object represents a point on a specific gradient defined in the Illustrator application. Each gradient stop specifies a color change in the containing gradient. Example 16.1 This example demonstrates how to reverse the colors in a gradient by getting, then switching, the colors of the contained gradient stops. -- This handler reverses the colors in gradient identified -- by the gradientRef parameter on ReverseGradientColors(gradientRef) tell application "Illustrator CS" -- Get a list of the gradient's colors set colorList to color of every gradient stop of gradientRef -- Tell AppleScript to reverse the order of the list set colorList to reverse of colorList -- Iterate over the gradient resetting its colors set colorCount to count items in colorList repeat with i from 1 to colorCount set color of gradient stop i of gradientRef to (item i of colorList) end repeat end tell end ReverseGradientColors -- call handler tell application "Illustrator CS" to set gradientRef to ¬ gradient 1 of document 1 ReverseGradientColors(gradientRef) 12 Aug 03