Adobe photoshop cs 2.0 User Guide

Page of 91
Photoshop CS2
Adobe Photoshop CS2  Scripting Guide
 Scripting Photoshop CS2     65
someColor.cmyk
'someColor.model = 2 indicates psColorModel --> 2 (psRGBModel)
End If
Look up the following in the Adobe Photoshop CS2 Visual Basic Scripting Reference:
model
 and 
cmyk
 in the 
Properties
 table of the SolidColor object
JS
This example uses the 
foregroundColor
 property of the 
Application
 object to get the original color to 
be converted. 
var someColor = foregroundColor.cmyk
Look up the following in the Adobe Photoshop CS2 JavaScript Scripting Reference:
cmyk
 in the Properties table of the 
SolidColor
 object
foregroundColor
 in the Properties table of the Application object
Comparing Colors
Using the 
equal colors/IsEqual/isEqual()
 command/method, you can compare colors. The following 
statements return 
true
 if the foreground color is visually equal to background color. 
AS
if equal colors foreground color with background color then
VBS
If (appRef.ForegroundColor.IsEqual(appRef.BackgroundColor)) Then
JS
if (app.foregroundColor.isEqual(backgroundColor))
 
Getting a Web Safe Color
To convert a color to a web safe color use the 
web safe color
 command on AppleScript and the 
NearestWebColor/nearestWebColor
 property of the
 SolidColor
 object for VBScript and JavaScript. 
AS
set myWebSafeColor to web safe color for foreground color
VBS
Dim myWebSafeColor 
Set myWebSafeColor = appRef.ForegroundColor.NearestWebColor
JS
var webSafeColor = new RGBColor()
webSafeColor = app.foregroundColor.nearestWebColor
Working with Filters
To apply a filter in an AppleScript, you use the 
filter
 command with an option from the 
Class filter 
options
. In VBScript and JavaScript, you use a specific filter method. For example, to apply a Gaussian blur 
filter, you use the 
ApplyGaussianBlur/applyGaussianBlur() 
method. All filter methods belong to the 
ArtLayer
 object. 
Note:
Please refer to Photoshop CS2 Help for information about the effects produced by individual filter 
types.