Adobe 65014293 Scripting Guide - Page 16
Additional objects, Constants, Introduction to Scripting, comment
UPC - 883919153544
View all Adobe 65014293 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 16 highlights
CHAPTER 2: Photoshop Scripting Basics Photoshop Object Model 16 Additional objects The Photoshop object model includes additional objects beyond the ones described in the containment hierarchy above. Most of these classes are used as types for properties or to provide information (as arguments) for commands or methods. For example: ➤ The color value (SolidColor/SolidColor) class provides the type for the background color (backgroundColor/backgroundColor) and foreground color (ForegroundColor/foregroundColor) properties of the Application object. See "Working with color objects" on page 51. ➤ Open and save options for documents are defined as classes, and these are passed to the commands that open and save documents; e.g., the BMP save options (BMPSaveOptions/BMPSaveOptions) class can be passed as an argument to the save (saveAs/saveAs) command or method. See "Opening a Document" on page 28 and "Saving a Document" on page 31. Constants An additional important component of the Photoshop object model for JavaScript and VBScript are constants. Constants are a type of value that defines a property. For example, with the kind property of an Art Layer object, you can define only specific kinds that Photoshop allows. For general information about constants, see Introduction to Scripting. NOTE: Throughout this document, actual values of enumerations for VBScript are given using the following format: newLayerRef.Kind = 2 '2 indicates psLayerKind --> 2 (psTextLayer) 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 about using comments, see Introduction to Scripting. For example, look up the art ArtLayer object in either the Adobe Photoshop CS4 JavaScript Scripting Reference or in the Adobe Photoshop CS4 Visual Basic Scripting Reference. One of the properties of this object is Kind( kind). The value type for that property contains a link to the constant that define the allowed values for the property. For VBScript, the constant is PSLayerKind, for JavaScript, the constant is LayerKind. Click the link to view the values you can use to define the kind property. NOTE: Different objects can use the same property name with different constant values. The constant values for the Channel object's kind property are different than the constant values for the Art Layer object's kind property.