Understanding Object Classes And Inheritance; Using Arrays - Adobe PHOTOSHOP CS 2.0 - SCRIPTING GUIDE Manual

Table of Contents

Advertisement

Adobe Photoshop CS2 Scripting Guide
Understanding and Finding Constants
Constants are a type of value that defines a property. Using the example of the
object, you can define only specific kinds that Photoshop CS2 allows.
Layer
In JavaScript, you must use constants exactly as they are defined—with the exact spelling and
capitalization. In VBScript, you use a constant's enumerated value.
Note:
Throughout this document, actual values of enumerations are given using the following format:
The ' before the explanation creates a comment and prevents the text to the right of the ' from being
read by the scripting engine. For more information, see
information on comments.
A constant is indicated as a hypertext link in the Value Type column of the Properties table in the scripting
language reference. When you click the link, you can view the list of possible values for the property.
For example, look up the
on the installation CD:
Adobe Photoshop CS2 Visual Basic Scripting Reference
Adobe Photoshop CS2 JavaScript Scripting Reference
In the Properties table, look up
the values you can use to define the
Note:
Different objects can use the same property with different constant values. The constant values for
the
object's

Understanding Object Classes and Inheritance

In Photoshop CS2, every type of object— document, layer, etc.—belongs to its own class, each with its
own set of properties and behaviors.
Object classes may also "inherit, " or share, the properties of a parent, or superclass. When a class inherits
properties, we call that class a child or subclass of the class from which it inherits properties. In
Photoshop CS2,
Classes can have properties that aren't shared with their superclass. Using an example from our house
object, both window objects and door objects might inherit an "opened" property from the parent
Opening
have.
In Photoshop CS2 for example,
from the
When you use the scripting language reference documents included on the installation CD, if you
encounter the term inherited from, it indicates that the object class you are looking at is a child class of the
parent class named in the definition.

Using Arrays

In VBScript and JavaScript, arrays are similar to collections; however, arrays are not created automatically.
You can think of an array as a list of values for a single variable. For example, the following JavaScript array
lists 4 values for the variable
var myFiles = new Array ()
myFiles[0] = "clouds.bmp"
newLayerRef.Kind = 2 '2 indicates psLayerKind --> 2 (psTextLayer)
Art Layer
kind
object's
Channel
kind
property.
kind
objects, for example, inherit from the
Art Layer
class, but a window could have a
Art Layer
class.
Layer
myFiles
Photoshop CS2
object in the "Interface" chapter of any of the following references
. The Value Type column for
property.
kind
property are different than the constant values for the
numberOfPanes
objects have the property
:
kind
Documenting Scripts
contains a link. Click the link to view
kind
class.
Layer
property which the
Opening
which is not inherited
grouped
Scripting basics
19
property of an
Art
for more
Art Layer
class could not

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Photoshop cs2

Table of Contents