
Adobe Photoshop CS3
JavaScript Scripting Reference
JavaScript Object Reference 81
ColorSamplers
The collection of
ColorSampler
objects in the document. See
ColorSampler
.
Note:
Because the
ColorSampler
class is also a property of the
Document
object, you use the property
name,
colorSamplers
, rather than the class name,
ColorSamplers
, in your code. For example:
docRef.colorSamplers.removeAll()
The following sample uses the
ColorSamplers
object incorrectly:
docRef.ColorSamplers.removeAll()
Properties
Methods
Property
Value Type
What it is
length
number (long)
Read-only. The number of elements in the
ColorSamplers
collection.
parent
object (
Document
)
Read-only. The
ColorSamplers
object’s container.
typename
string
Read-only. The class name of the referenced
ColorSamplers
object.
Method
Parameter Type
Returns
What it does
index
(itemKey)
number
ColorSampler
Gets an element from the
ColorSamplers
collection.
add
(position)
array of UnitValue
ColorSampler
Creates a new
ColorSampler
object.
The
position
parameter (x,y)
represents the new horizontal and
vertical locations, respectively, of the
moved color sampler.
Note:
For information about the
UnitValue
object, see the
JavaScript Tools Guide
getByName
(name)
string
ColorSampler
Get the first element in the
ColorSamplers
collection with the
provided name.
removeAll
()
Removes all
ColorSampler
objects
from the
ColorSamplers
collection.