Sg2.9
Constructing a Swatch
Recent RSS
Constructing a Swatch
From:  Thijs Gadiot
Date:  25. February 2007, 14:58

Hey all,

Has anyone of you had any luck creating a new swatch with the Swatch() constructor? I keep getting this error:

ReferenceError: "Swatch" is not defined.

Thanks.

Re: Constructing a Swatch
Date:  25. February 2007, 16:32

Sure you have the latest version of Scripto installed?

The following works for me:

var swatch = new Swatch();
swatch.name = "Reddy"
swatch.color = RGBColor(1,0,0)

var sL = activeDocument.swatches.length
activeDocument.swatches[sL]=swatch;
Re: Constructing a Swatch
From:  Thijs Gadiot
Date:  25. February 2007, 19:19

Hey,

Thanks for the quick reply, I didn't have the latest version (16.02.2007), it works now!

—mooie smiley!

Scripts
08.08.14, 15:24
15.05.14, 14:23
02.03.14, 19:16
18.11.13, 14:48
22.03.13, 03:05
22.02.13, 15:45
Posts
10.01.17, 16:37
19.02.16, 06:03
19.02.16, 06:00
17.01.16, 11:00
12.01.16, 13:10
25.11.15, 08:19
Script of the Moment
Cross Hatch Raster 15.03.12