Adobe 26001360 - Illustrator CS - PC Manual page 111

Scripting guide
Hide thumbs Also See for 26001360 - Illustrator CS - PC:
Table of Contents

Advertisement

Adobe Illustrator CS Scripting Guide
Notes
Illustrator's gradient object represents a gradient as defined in the Illustrator application.
Additional gradients may be created by the user within Illustrator or via a script.
Example 14.1
This example shows how to create a linear RGB gradient.
-- Create a new RGB gradient with three gradient stops
property pGradientName : "RGB Hot Streak"
tell application "Illustrator CS"
if not (exists gradient pGradientName in current document) then
set newgradient to make new gradient at beginning of current document ¬
with properties {name:pGradientName, gradient type:linear}
-- Since all new gradients are created with 2 gradient stops,
-- create another stop for the 3 stop gradient
make new gradient stop at beginning of newgradient
set properties of gradient stop 1 of newgradient to ¬
{midpoint:50.0, ramp point:0.0, color:{red:255.0, green:255.0, blue:0.0}}
set properties of gradient stop 2 of newgradient to ¬
{midpoint:50.0, ramp point:50.0, color:{red:255.0, green:127.0,
blue:127.0}}
set properties of gradient stop 3 of newgradient to ¬
{midpoint:50.0, ramp point:100.0, color:{red:255.0, green:0.0, blue:0.0}}
end if
end tell
12 Aug 03
111

Advertisement

Table of Contents
loading

This manual is also suitable for:

Illustrator cs

Table of Contents