Macromedia Photoshop - CS2 User Guide

®
®
2
cs
Photoshop
AppleScript Scripting Reference
Adobe
bbc
© 2005 Adobe Systems Incorporated. All rights reserved.
®
AppleScript Scripting Reference for Windows® and Macintosh®.
NOTICE: All information contained herein is the property of Adobe Systems Incorporated. No part of this publication (whether in hardcopy or electronic form) may be reproduced or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior written consent of Adobe Systems Incorporated. The software described in this document is furnished under license and may only be used or copied in accordance with the terms of such license.
This publication and the information herein is furnished AS IS, is subject to change without notice, and should not be construed as a commitment by Adobe Systems Incorporated. Adobe Systems Incorporated assumes no responsibility or liability for any errors or inaccuracies, makes no warranty of any kind (express, implied, or statutory) with respect to this publication, and expressly disclaims any and all warranties of merchantability, fitness for particular purposes, and noninfringement of third party rights.
Any references to company names in sample templates are for demonstration purposes only and are not intended to refer to any actual organization.
Adobe, the Adobe logo, Acrobat, Illustrator, and Photoshop are either registered trademarks or trademarks of Adobe Systems Incorporated in the United States and/or other countries.
Apple, Mac, and Macintosh are trademarks of Apple Computer, Inc., registered in the United States and other countries. Microsoft, and Windows are either registered trademarks or trademarks of Microsoft Corporation in the United States and other countries. JavaScript and all Java-related marks are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries. UNIX is a registered trademark of The Open Group.
All other trademarks are the property of their respective owners.
If this guide is distributed with software that includes an end user agreement, this guide, as well as the software described in it, is furnished under license and may be used or copied only in accordance with the terms of such license. Except as permitted by any such license, no part of this guide may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, recording, or otherwise, without the prior written permission of Adobe Systems Incorporated. Please note that the content in this guide is protected under copyright law even if it is not distributed with software that includes an end user license agreement.
The content of this guide is furnished for informational use only, is subject to change without notice, and should not be construed as a commitment by Adobe Systems Incorporated. Adobe Systems Incorporated assumes no responsibility or liability for any errors or inaccuracies that may appear in the informational content contained in this guide.
Adobe Systems Incorporated, 345 Park Avenue, San Jose, California 95110, USA.

Contents

1 Introduction ................................................................................................................................. 8
Changes Since Earlier Versions.................................................................................................................................................. 8
2 Action Manager ........................................................................................................................... 9
Running JavaScript based Action Manager code from AppleScript............................................................................ 9
3 AppleScript Objects................................................................................................................... 10
add noise .........................................................................................................................................................................................11
adjustment options .....................................................................................................................................................................12
application......................................................................................................................................................................................13
art layer, art layers ........................................................................................................................................................................15
automatic contrast.......................................................................................................................................................................18
automatic levels............................................................................................................................................................................19
batch options.................................................................................................................................................................................20
Bitmap mode options.................................................................................................................................................................22
blur.....................................................................................................................................................................................................23
blur more.........................................................................................................................................................................................24
BMP save options .........................................................................................................................................................................25
brightness and contrast.............................................................................................................................................................27
camera raw open options .........................................................................................................................................................28
change mode options ................................................................................................................................................................30
channel, channels.........................................................................................................................................................................31
clouds ...............................................................................................................................................................................................33
CMYK color......................................................................................................................................................................................34
color balance..................................................................................................................................................................................35
color value.......................................................................................................................................................................................36
contact sheet options.................................................................................................................................................................37
curves................................................................................................................................................................................................39
custom filter ...................................................................................................................................................................................40
deinterlace......................................................................................................................................................................................41
desaturate .......................................................................................................................................................................................42
despeckle ........................................................................................................................................................................................43
difference clouds..........................................................................................................................................................................44
diffuse glow....................................................................................................................................................................................45
displace filter..................................................................................................................................................................................46
document, documents...............................................................................................................................................................47
dust and scratches .......................................................................................................................................................................51
EPS open options .........................................................................................................................................................................52
EPS save options...........................................................................................................................................................................53
equalize............................................................................................................................................................................................55
export options save for web.....................................................................................................................................................56
filter options...................................................................................................................................................................................58
font, fonts........................................................................................................................................................................................59
gallery banner options ...............................................................................................................................................................60
gallery color options ...................................................................................................................................................................61
gallery images options ...............................................................................................................................................................62
3
Adobe Photoshop CS2
AppleScript Scripting Reference 4
gallery options...............................................................................................................................................................................63
gallery security options..............................................................................................................................................................65
gallery thumbnail options.........................................................................................................................................................66
Gaussian blur .................................................................................................................................................................................67
GIF save options............................................................................................................................................................................68
glass filter ........................................................................................................................................................................................70
gray color.........................................................................................................................................................................................71
high pass..........................................................................................................................................................................................72
history state, history states .......................................................................................................................................................73
HSB color .........................................................................................................................................................................................74
Illustrator paths export options ..............................................................................................................................................75
indexed mode options ...............................................................................................................................................................76
info-object.......................................................................................................................................................................................78
inversion ..........................................................................................................................................................................................80
JPEG save options ........................................................................................................................................................................81
Lab color ..........................................................................................................................................................................................82
layer, layers .....................................................................................................................................................................................83
layer comp, layer comps............................................................................................................................................................85
layer set, layer sets .......................................................................................................................................................................86
lens blur ...........................................................................................................................................................................................89
lens flare...........................................................................................................................................................................................91
levels adjustment .........................................................................................................................................................................92
maximum filter..............................................................................................................................................................................93
median noise..................................................................................................................................................................................94
minimum filter...............................................................................................................................................................................95
mix channels ..................................................................................................................................................................................96
motion blur.....................................................................................................................................................................................97
no color ............................................................................................................................................................................................98
notifier, notifiers............................................................................................................................................................................99
NTSC colors.................................................................................................................................................................................. 100
ocean ripple................................................................................................................................................................................. 101
offset filter.................................................................................................................................................................................... 102
open options............................................................................................................................................................................... 103
path item, path items............................................................................................................................................................... 104
path point, path points ........................................................................................................................................................... 106
path point info............................................................................................................................................................................ 107
PDF open options...................................................................................................................................................................... 108
PDF save options ....................................................................................................................................................................... 110
Photo CD open options........................................................................................................................................................... 113
Photoshop DCS 1.0 save options......................................................................................................................................... 114
Photoshop DCS 2.0 save options......................................................................................................................................... 116
Photoshop save options ......................................................................................................................................................... 118
PICT file save options ............................................................................................................................................................... 119
PICT resource save options.................................................................................................................................................... 120
picture package options......................................................................................................................................................... 121
pinch .............................................................................................................................................................................................. 123
Pixar save options ..................................................................................................................................................................... 124
PNG save options ...................................................................................................................................................................... 125
polar coordinates ...................................................................................................................................................................... 126
posterize ....................................................................................................................................................................................... 127
presentation options...........................................................................................................
..................................................... 128
Adobe Photoshop CS2
AppleScript Scripting Reference 5
radial blur ..................................................................................................................................................................................... 130
raw format open options........................................................................................................................................................ 131
raw save options........................................................................................................................................................................ 132
RGB color ...................................................................................................................................................................................... 133
RGB hex color.............................................................................................................................................................................. 134
ripple.............................................................................................................................................................................................. 135
save options ................................................................................................................................................................................ 136
selection-object ......................................................................................................................................................................... 137
selective color............................................................................................................................................................................. 138
settings-object ........................................................................................................................................................................... 139
SGI RGB save options ............................................................................................................................................................... 143
sharpen ......................................................................................................................................................................................... 144
sharpen edges ............................................................................................................................................................................ 145
sharpen more.............................................................................................................................................................................. 146
shear............................................................................................................................................................................................... 147
smart blur..................................................................................................................................................................................... 148
spherize......................................................................................................................................................................................... 149
sub path info............................................................................................................................................................................... 150
sub path item, sub path items.............................................................................................................................................. 151
Targa save options.................................................................................................................................................................... 152
text-object.................................................................................................................................................................................... 153
texture fill ..................................................................................................................................................................................... 161
threshold adjustment .............................................................................................................................................................. 162
TIFF save options....................................................................................................................................................................... 163
twirl................................................................................................................................................................................................. 165
unsharp mask.............................................................................................................................................................................. 166
wave filter..................................................................................................................................................................................... 167
XMP metadata ............................................................................................................................................................................ 168
zigzag............................................................................................................................................................................................. 169
4 AppleScript Commands .......................................................................................................... 170
Overview....................................................................................................................................................................................... 170
activate.......................................................................................................................................................................................... 171
adjust ............................................................................................................................................................................................. 172
apply .............................................................................................................................................................................................. 173
apply layer style ......................................................................................................................................................................... 174
change mode.............................................................................................................................................................................. 175
close ............................................................................................................................................................................................... 176
clear................................................................................................................................................................................................ 177
contract......................................................................................................................................................................................... 178
convert .......................................................................................................................................................................................... 179
convert color............................................................................................................................................................................... 179
convert to shape........................................................................................................................................................................ 179
copy................................................................................................................................................................................................ 180
copy merged............................................................................................................................................................................... 180
count.............................................................................................................................................................................................. 181
create PDF presentation ......................................................................................................................................................... 182
create photo gallery ................................................................................................................................................................. 182
create selection.......................................................................................................................................................................... 182
create work path........................................................................................................................................................................ 183
crop................................................................................................................................................................................................. 184
Adobe Photoshop CS2
AppleScript Scripting Reference 6
cut ................................................................................................................................................................................................... 185
delete............................................................................................................................................................................................. 186
deselect......................................................................................................................................................................................... 187
do action....................................................................................................................................................................................... 188
do javascript................................................................................................................................................................................ 189
duplicate....................................................................................................................................................................................... 190
equal colors ................................................................................................................................................................................. 191
exists .............................................................................................................................................................................................. 192
expand........................................................................................................................................................................................... 193
export ............................................................................................................................................................................................ 194
feather ........................................................................................................................................................................................... 195
fill..................................................................................................................................................................................................... 196
fill path .......................................................................................................................................................................................... 196
filter ................................................................................................................................................................................................ 198
flatten ............................................................................................................................................................................................ 199
flip canvas .................................................................................................................................................................................... 200
grow ............................................................................................................................................................................................... 201
import annotations................................................................................................................................................................... 202
index .............................................................................................................................................................................................. 203
invert.............................................................................................................................................................................................. 204
link .................................................................................................................................................................................................. 205
load................................................................................................................................................................................................. 206
make............................................................................................................................................................................................... 207
make clipping path................................................................................................................................................................... 207
make work path ......................................................................................................................................................................... 208
merge............................................................................................................................................................................................. 209
merge visible layers.................................................................................................................................................................. 209
move .............................................................................................................................................................................................. 210
open ............................................................................................................................................................................................... 211
paste............................................................................................................................................................................................... 212
print................................................................................................................................................................................................ 213
purge.............................................................................................................................................................................................. 214
quit.................................................................................................................................................................................................. 215
rasterize......................................................................................................................................................................................... 216
recapture ...................................................................................................................................................................................... 217
reset from comp ........................................................................................................................................................................ 218
resize canvas ............................................................................................................................................................................... 219
resize image................................................................................................................................................................................. 219
reveal all........................................................................................................................................................................................ 220
rotate ............................................................................................................................................................................................. 221
rotate boundary......................................................................................................................................................................... 221
rotate canvas............................................................................................................................................................................... 221
save................................................................................................................................................................................................. 223
scale................................................................................................................................................................................................ 225
scale boundary........................................................................................................................................................................... 225
select.............................................................................................................................................................................................. 226
select all ........................................................................................................................................................................................ 226
select border ............................................................................................................................................................................... 226
similar ............................................................................................................................................................................................ 227
smooth .......................................................................................................................................................................................... 228
split channels .................................................................................................................
............................................................. 229
Adobe Photoshop CS2
AppleScript Scripting Reference 7
store................................................................................................................................................................................................ 230
stroke ............................................................................................................................................................................................. 231
stroke path................................................................................................................................................................................... 231
translate ........................................................................................................................................................................................ 232
translate boundary ................................................................................................................................................................... 233
trap ................................................................................................................................................................................................. 234
trim ................................................................................................................................................................................................. 235
unlink ............................................................................................................................................................................................. 236
web safe color............................................................................................................................................................................. 237
Appendix A: Event ID Codes ................................................................................................... 238
Index .........................................................................................................................................246
1

Introduction

This reference describes the objects and commands in the Adobe® Photoshop® CS2 AppleScript dictionary. A companion document, Photoshop CS2 Scripting Guide, describes basic scripting concepts and the Photoshop object model. This document provides reference details of the Photoshop object model, and additional information on AppleScript-specific features.
This book contains the following sections:
This introduction, which describes scripting support in Adobe Photoshop CS2, and lists changes to the
AppleScript interface since the previous release.
AppleScript Objects, which provides a complete reference for all Photoshop DOM objects and
commands.
AppleScript Commands, which provides a complete reference for all AppleScript Photoshop DOM commands.

Changes Since Earlier Versions

The following changes have been made to the AppleScript object model and language support in Adobe Photoshop CS2:
Support for interapplication communication among Creative Suite 2 applications through exported
ExtendScript functions and interapplication messaging. For details, see the Creative Suite 2 Bridge JavaScript Reference.
The following classes have been added to the AppleScript interface:
camera raw open options, which you use to specify options when opening a document in
camera raw format.
export options save for web, which you use to optimize documents for the Web.
contact sheet options, which you use to create and format contact sheets.
batch options, which you use to specify options for the Batch command.
lens blur options, which you use to specify options when applying the Lens Blur filter to a layer.
8
2

Action Manager

Adobe Photoshop CS2 actions allow you to save time by automating repetitive tasks.
Note: You create and run actions in the application interface using the Actions palette.
You can manage actions in scripts using a utility called the Action Manager. The Action Manager also allows you to write scripts that target Adobe Photoshop CS2 functionality that is not otherwise accessible in the scripting interface, such as third party plug-ins and filters that are available through the application but not in the current scripting reference.
The only requirement for using the Action Manager is that the task that you want to access from the Action Manager is recordable.
This chapter describes how to use the Action Manager and the scripting interface objects it includes.

Running JavaScript based Action Manager code from AppleScript

There is no Action Manager functionality in AppleScript. However, you can execute JavaScript code and files from AppleScript using the
You need to rewrite your JavaScript code slightly to work with the do javascript command’s arguments in order to get access to the AppleScript values from JavaScript. For example save the following JavaScript
Emboss.jsx:
as
do javascript command. See ‘do javascript’ on page 189.
function emboss(angle, height, amount) {
var id32 = charIDToTypeID("Embs"); var desc7 = new ActionDescriptor(); var id33 = charIDToTypeID("Angl"); desc7.putInteger(id33, angle); var id34 = charIDToTypeID("Hght"); desc7.putInteger(id34, height); var id35 = charIDToTypeID("Amnt"); desc7.putInteger(id35, amount); executeAction(id32, desc7);
}
In your AppleScript, call the Emboss function with values provided in the arguments collection, as follows:
emboss(arguments[0], arguments[1], arguments[2]);
The following AppleScript code sample runs the Emboss filter:
tell application "Adobe Photoshop CS2"
do javascript (file <path to Emboss.jsx>) ¬
with arguments { 75,2,89 }
end tell
Note: For information on creating JavaScripts to use with the Action Manager, see Action Manager chapter
in the Adobe Photoshop CS2 JavaScript Scripting Reference, which is available on the installation CD.
9
3

Elements

AppleScript Objects

The objects of the AppleScript dictionary for Adobe Photoshop CS2 are presented alphabetically and in tabular format in this chapter. Where appropriate, the object class has two tables:
Element — Lists the classes that inherit from the current class, as well as the methods by which the
classes can be referred.
Property — The properties you can use with the object, as well as each property’s value type, input
status, and description.
The commands that can be used with an object are listed below the object’s Properties table.
Sample code for several object classes is given to help illustrate the syntax as well as usage of the object class.
The following sample tables and command list illustrate the format for this chapter.
Element Refer to by
channel

Properties

Property Value Type What it is

bits per channel

component channels

current channels

current layer

info

Valid Commands
change mode close convert count
name, numeric index, as a range of elements, before
after another element, satisfying a test
Valid values:
eight one sixteen
list of channels
list of channel
layer
info-object
The number of bits per channel.
Read-only. A list of the component color channels.
The selected channels.
The selected layer.
Read-only. The document metadata.
10
Adobe Photoshop CS2
AppleScript Scripting Reference AppleScript Objects 11

add noise

Options that may be supplied when applying an Add Noise filter.
add noise class supplies properties for the filter options class. The add noise class is used only
The to define a record whose properties specify options when applying an Add Noise filter. options can be supplied only in conjunction with the filter command. It is not possible to get or create
add noise object.
an
See the filter command for additional details.

Properties

Property Value Type What it is
add noise
amount
distribution
monochromatic
real
Valid values:
Gaussian uniform
boolean
(amount: 0.1% - 400%)
The following code sample demonstrates how to apply the add noise filter using the filter command of the
add noise class (inherited from the filter options super class).
... filter current layer of the current document using add noise filter ¬
with options {class:add noise, distribution:uniform ¬ monochromatic:false}
Adobe Photoshop CS2
AppleScript Scripting Reference AppleScript Objects 12

adjustment options

Options used with the adjust method. The following classes inherit properties from the adjustment options class: automatic contrast, automatic levels, brightness and contrast, color balance, curves,
desaturate, equalize, inversion, levels adjustment, mix channels, posterize, selective color, threshold adjustment.
Valid Commands
adjust
Adobe Photoshop CS2
AppleScript Scripting Reference AppleScript Objects 13

application

The Adobe Photoshop CS2 application object, which contains all other Adobe Photoshop CS2 objects.

Elements

Elements Refer to by
document name, numeric index, as a range of elements, before/
after another element, satisfying a test
font name, numeric index, as a range of elements, before/

Properties

Property Value type What it is
best type
class
default type
properties
background color
color settings
current document
display dialogs
after another element, satisfying a test
type class
type class
type class
record
Read-only. The best type for the object's value.
Read-only. The object's class.
Read-only. The default type for the object's value.
All of this object's properties returned in a single record.
color value
string or color object
document
Valid Values:
always error dialogs never
The color for the document’s background color.
The name of selected color setting’s set.
The frontmost document.
Controls whether and dialogs are displayed while the script is running.
foreground color
free memory
frontmost
locale
name
preferences folder
scripting version
color value
real
boolean
string
Unicode text
alias
Unicode text
The default foreground color (used to fill and stroke selections).
Read-only. The amount of unused memory available to Adobe Adobe Photoshop CS2.
Read-only. Indication of whether Adobe Photoshop CS2 is the frontmost application.
Read-only. The language location of the application.
Read-only. The application's name.
Read-only. The full path to the Preferences folder.
Read-only. The scripting interface version.
Adobe Photoshop CS2
AppleScript Scripting Reference AppleScript Objects 14
Property Value type What it is (Continued)
settings
settings-object
Read-only. The application preference settings (equivalent to selecting Edit > Preferences in the Adobe Photoshop CS2 application in Windows or Photoshop > Preferences in Mac OS).
version
Unicode text
Read-only. The Adobe Photoshop version.
The the first line of the following code sample directs Adobe Photoshop CS2 to carry out the script’s commands. The second line uses the
activate command to make Adobe Photoshop CS2 the frontmost
application.
tell application "Adobe Photoshop CS2"
activate
end tell
Valid Commands
activate quit
Adobe Photoshop CS2
AppleScript Scripting Reference AppleScript Objects 15

art layer, art layers

Any layer that can contain data. The art layer class inherits properties from the layer, layers class.

Properties

Property Value Type What it is
best type
class type
default type
index
properties
all locked
blend mode
type class
class
type class
integer
record
boolean
Valid Values:
color blend color burn color dodge darken difference dissolve exclusion hard light hue blend lighten linear burn linear dodge linear light luminosity multiply normal overlay pass through pin light saturation blend screen soft light vivid light
Read-only. (Inherited from the layer class) The best type for the object's value.
Read-only. (Inherited from the layer class) The object’s class.
Read-only. (Inherited from the layer class) The default type for the object’s value.
Read-only. (Inherited from the layer class) The index of this instance of the object.
Read-only. (Inherited from the layer class) All of this object’s properties returned in a single record.
Read-only. (Inherited from the layer class) Indication of whether all of the layer’s contents are locked or editable.
(Inherited from the layer class) The mode used when compositing an object.
bounds
container
list
reference
Read-only. (Inherited from the layer class) A list of coordinates that describes the bounding rectangle of the layer.
Read-only. (Inherited from the layer class) The object’s container.
Adobe Photoshop CS2
AppleScript Scripting Reference AppleScript Objects 16
Property Value Type What it is (Continued)
linked layers
name
opacity
visible
background layer
fill opacity
grouped
kind
list of layers
Unicode text
real
boolean
boolean
real
boolean
Valid Values:
brightness contrast layer channel mixer layer color balance layer curves layer gradient fill layer gradient map layer hue saturation layer inversion layer levels layer normal pattern fill layer posterize layer smart object layer selective color layer solid fill layer text layer threshold layer
Read-only. (Inherited from the layer class) The layers linked to this layer.
(Inherited from the layer class) The layer’s name.
(Inherited from the layer class) The layer’s master opacity (0.0 - 100.0).
(Inherited from the layer class) Indication of whether the layer is visible.
Indication of whether the layer is a background layer.
The layer’s interior opacity (0.0 - 100.0).
Indication of whether the layer is grouped with the layer below.
Sets the layer’s kind (such as 'text layer').
Note: You can use the
kind property to make
a background layer a normal layer; however, to make a layer a background layer, you must use
background layer.
Note: Valid only when the layer is empty and
background layer is false. See
when
background layer.
pixels locked
position locked
text object
transparent position locked
Valid Commands
adjust apply layer style clear
boolean
boolean
text-object
boolean
Indicates whether the pixels in the layer’s image can be edited using the paintbrush tool.
Indicates whether the pixels in the layer’s image can be moved within the layer.
Read-only. The text item that is associated with the art layer.
Note: Valid only when
kind: text layer.
Indicates whether editing is confined to the opaque portions of the layer.
Adobe Photoshop CS2
AppleScript Scripting Reference AppleScript Objects 17
copy copy merged count cut delete duplicate exists filter index invert link make merge move rasterize rotate scale translate unlink
The following code creates a text layer by creating an art layer and setting its kind property to text
layer
, assigns the color to the variable theTextColor, and then uses the variable to set the text color to the
RGB color.
tell application "Adobe Photoshop CS2"
activate
--create a variable named theDocRef
--assign the current (active) document to it set theDocRef to the current document
--create a variable for the text layer, create the layer as an art layer object
--and use the kind property of the art layer object to make it a text layer set theTextLayer to make new art layer in theDocRef with¬
properties {kind:text layer}
end tell
Adobe Photoshop CS2
AppleScript Scripting Reference AppleScript Objects 18

automatic contrast

The automatic contrast class supplies options properties for the adjustment options class to automatically adjust the overall contrast and mixture of colors in an RGB image.
automatic contrast class, which is analogous to the Auto Contrast command in the Adobe
The Photoshop CS2 application, is used only to define a record containing properties that specify options when using the
contrast
create an
See the adjust command for additional details.
The following code sample demonstrates how to apply an Automatic Contrast adjustment using the
adjust command of the automatic contrast class (inherited from the adjustment options super
class).
... adjust current layer of the current document using automatic contrast adjustment¬
with options {class:automatic contrast}
adjust command to apply an Auto Contrast adjustment to an image. The automatic
class can be used only in conjunction with the adjust command. It is not possible to get or
automatic contrast object.
Adobe Photoshop CS2
AppleScript Scripting Reference AppleScript Objects 19

automatic levels

The automatic levels class supplies options properties for the adjustment options class to automatically adjust the black point and white point in an image.
automatic levels class, which is analogous to the Auto Levels command in the Adobe Photoshop
The CS2 application, is used only to define a record containing properties that specify options when using the
adjust command to apply an Auto Levels adjustment to an image. The automatic levels class can be
used only in conjunction with the
levels
object.
See the adjust command for additional details.
adjust command. It is not possible to get or create an automatic
The following code sample demonstrates how to apply an Automatic Levels adjustment using the command of the
... adjust current layer of the current document using automatic levels adjustment¬
with options {class:automatic levels}
automatic levels class (inherited from the adjustment options super class).
adjust
Adobe Photoshop CS2
AppleScript Scripting Reference AppleScript Objects 20

batch options

Options to specify when running a Batch command.

Properties

Property Value type What it is
destination
destination folder
error file
file naming
Valid values:
folder
no destination
save and close
alias
alias
Valid values:
ddmm ddmmyy documentnamelower documentnamemixed documentnameupper extensionlower extensionupper mmdd mmddyy serialletterlower serialletterupper serialnumber1 serialnumber2 serialnumber3 serialnumber4 yyddmm yymmdd yyyymmdd
The type of destination for the processed files (default:
no destination).
The folder location for the processed files.
Note: Valid only when
destination.
See
destination: folder.
The file in which to log errors encountered.
Note: To display errors on the screen (and stop
batch processing when errors occur) leave blank.
A list of file naming options (maximum: 6).
Note: Valid only when
destination.
See
destination:folder.
macintoshCompatible
overrideOpen
boolean
boolean
Indication of whether to make the final file nameS Macintosh compatible (default:
Note: Valid only when
destination.
See
destination:folder.
true).
Indication of whether to override action open commands (default:
false).
Adobe Photoshop CS2
AppleScript Scripting Reference AppleScript Objects 21
Property Value type What it is (Continued)
overrideSave
startingSerial
suppressOpen
suppressProfile
typename
unixCompatible
boolean
number (long)
boolean
boolean
string
boolean
Indication of whether to override save as action steps with the specified destination (default:
false).
Note: Valid only when
destination:save and close
See
destination.
destination:folder or
.
The starting serial number to use in naming files (default:
Note: Valid only when
1).
destination.
See
destination:folder.
Indication of whether to suppress the file open options dialogs (default:
false).
Indication of whether to suppress the color profile warnings (default:
false).
Read-only. The class name of the referenced
batchOptions object.
Indication of whether to make the final file name Unix compatible (default:
true).
windowsCompatible
boolean
Note: Valid only when
destination.
See
destination:folder.
Indication of whether to make the final file names Windows compatible (default:
Note: Valid only when
See
destination.
destination:folder.
true).
Adobe Photoshop CS2
AppleScript Scripting Reference AppleScript Objects 22

Bitmap mode options

Options that can be specified when changing the document mode to Bitmap using the change mode command. The
This class is used to define a record containing properties used to specify options when changing a document’s mode. command. It is not possible to get or create a command for more details.

Properties

Properties Value Type What it is
bitmap mode class inherits properties from the change mode options class.
Bitmap mode options can only be supplied in conjunction with the change mode
Bitmap mode options object. See the change mode
angle
conversion method
frequency
pattern name
resolution
real
Valid Values:
custom pattern diffusion dither halftone screen conversion middle threshold pattern dither
real
Unicode text
real
The angle (in degrees) at which to orient individual dots (-180 - 180). See
shape.
Note: Valid only when
method: halftone screen
conversion
screen
.
The conversion method to use (default:
diffusion dither).
The number of printer dots (per inch) to use (1.0 - 999.99).
Note: Valid only when
method: halftone screen
conversion
.
The name of the pattern to use.
Note: Valid only when
method: custom pattern
conversion
.
The output resolution (in pixels per inch) (default:
72.0).
screen shape
Valid values:
halftone cross halftone diamond halftone ellipse halftone line halftone round halftone square
The dot shape to use.
Note: Valid only when
method: halftone screen
conversion
.
Adobe Photoshop CS2
AppleScript Scripting Reference AppleScript Objects 23

blur

Options that may be supplied when applying a Blur filter.
blur class supplies properties for the filter options class. The blur class is used only to define a
The record when using the conjunction with the
See the
filter command for additional details.
filter command to apply a Blur filter. blur options can be supplied only in
filter command. It is not possible to get or create a blur object.
The following code sample demonstrates how to apply the blur filter using the filter command of the class (inherited from the filter options super class).
... filter current layer of the current document using blur filter with options {class:blur}
blur
Adobe Photoshop CS2
AppleScript Scripting Reference AppleScript Objects 24

blur more

The blur more class supplies properties for the filter options class when using the filter command apply a Blur More filter. The command to apply a Blur More filter. The
filter command. It is not possible to get or create a blur more object.
See the
filter command for additional details.
The following code sample demonstrates how to apply the blur more filter using the filter command of the
blur more class (inherited from the filter options super class).
... filter current layer of the current document using blur more filter with options {class:blur more}
blur more class is used only to define a record when using the filter
blur more option can be supplied only in conjunction with the
Adobe Photoshop CS2
AppleScript Scripting Reference AppleScript Objects 25

BMP save options

Options that can be specified when saving a document in BMP format. See the save command for additional details.The
This class is used to define a record containing properties used to specify options when saving a document as a BMP file. possible to get or create a

Properties

Property Value Type What it is
BMP save options can only be supplied in conjunction with the save command. It is not
BMP save options class inherits properties from the save options class.
BMP save options object.
bits per sample
flipped row order
RLE compression
Valid values:
A1R5G5B5 A4R4G4B4 A8R8G8B8 eight four one R5G6B5 R8G8B8 sixteen thirty two twenty four X1R5G5B5 X4R4G4B4 X8R8G8B8
boolean
boolean
The number of bits per channel (default: twenty
four
).
Indication of whether to write the image from top to bottom (default:
Note: Available only when
system: windows
system.
false).
target operating
. See target operating
Indication of whether to use RLE compression.
Note: Available only when
system: windows
system.
target operating
. See target operating
save alpha channels
target operating system
boolean
OS2 Windows
Indication of whether to save the alpha channels.
The target OS (default: Windows).
Adobe Photoshop CS2
AppleScript Scripting Reference AppleScript Objects 26
The following code creates the myOptions variable to hold the BMP save options, then uses the save command to save the document with the specified options. The code uses the default values for the properties
tell application "Adobe Photoshop CS2"
bits per channel (twentyfour) and target operating system (true).
make new document set myOptions to {class:BMP save options, ¬
save layers: true, save alpha channels: true¬ image compression: RLE compression:true, save annotations: true}
save current document in file myFile as BMP with options ¬
myOptions appending no extension without copying
end tell
Adobe Photoshop CS2
AppleScript Scripting Reference AppleScript Objects 27

brightness and contrast

The brightness and contrast class supplies options properties for the adjustment options class to adjust the tonal range of an image.
brightness and contrast class, which is analogous to the Brightness/Contrast command in the
The Adobe Photoshop CS2 application, is used only to define a record containing properties that specify options when applying a Brightness/Contrast adjustment to an image. The class can be used only in conjunction with the adjust command. It is not possible to get or create a
brightness and contrast object.
See the adjust command for additional details.

Properties

Property Value Type What it is
brightness and contrast
brightness level
contrast level
integer
integer
(-100 - 100)
(-100 - 100)
The following code sample demonstrates how to apply a Brightness/Contrast adjustment using the
adjust command of the brightness and contrast class (inherited from the adjustment options
super class).
... adjust current layer of the current document using brightness and contrast adjustment¬
with options {class:brightness and contrast}
Adobe Photoshop CS2
AppleScript Scripting Reference AppleScript Objects 28

camera raw open options

Options that can be specified when opening a document in Camera Raw format. The camera raw open
options
This class is used to define a record containing properties that specify options when opening a document in raw format. is not possible to get or create a

Properties

Property Value type What it is
class inherits properties from the open options class.
camera raw open options can be supplied only in conjunction with the open command. It
camera raw open options object.
bitsPerChannel
blueHue
blueSaturation
brightness
chromaticAberrationBY
chromaticAberrationRC
colorNoiseReduction
colorSpace
contrast
Valid values:
EIGHT ONE SIXTEEN THIRTYTWO
integer
integer
integer
integer
integer
integer
Valid values:
ADOBERGB COLORMATCHRGB PROPHOTORGB SRGB
integer
The number of bits per channel.
The blue hue of the shot (-100 - 100).
The blue saturation of the shot (-100 - 100).
The brightness of the shot (0 - 150).
The chromatic aberration B/Y of the shot (-100 -
100).
The chromatic aberration R/C of the shot (-100 -
100).
The color noise reduction of the shot (0 - 100).
The colorspace for the image.
The contrast of the shot (-50 - 100).
exposure
greenHue
greenSaturation
luminanceSmoothing
redHue
redSaturation
resolution
saturation
real
integer
integer
integer
integer
integer
real
integer
The exposure of the shot (4.0 - 4.0).
The green hue of the shot (-100 - 100).
The green saturation of the shot (-100 - 100).
The luminance smoothing of the shot (0 - 100).
The red hue of the shot (-100 - 100).
The red saturation of the shot (-100 - 100).
The resolution of the document in pixels per inch (1 - 999).
The saturation of the shot (-100 - 100).
Adobe Photoshop CS2
AppleScript Scripting Reference AppleScript Objects 29
Property Value type What it is (Continued)
settings
shadows
shadowTint
sharpness
size
temperature
tint
typename
vignettingAmount
Valid values:
CAMERA CUSTOM SELECTEDIMAGE
integer
integer
integer
Valid values:
EXTRALARGE LARGE MAXIMUM MEDIUM MINIMUM SMALL
integer
integer
string
integer
The global settings for all Camera RAW options.
The shadows of the shot (0 - 100).
The shadow tint of the shot (-100 - 100).
The sharpness of the shot (0 - 100).
The size of the new document.
The temperature of the shot (2000 - 50000).
The tint of the shot (-150 - 150).
Read-only. The class name of the referenced
cameraRawOpenOptions object.
The vignetting amount of the shot (-100 - 100).
vignettingMidpoint
integer
The vignetting mid point of the shot (-100 -
100).
whiteBalance
Valid values:
ASSHOT AUTO CLOUDY CUSTOM DAYLIGHT FLASH FLUORESCENT SHADE TUNGSTEN
The white balance options for the image.
The following code opens a camera raw document.
tell application "Adobe Photoshop CS2"
set myFilePath to alias “Applications:CRAWFiles:MyFile.jpeg” open myFilePath as camera raw with options ¬
{class:camera raw open options, bits per channel:eight, ¬ color noise reduction:20, temperature:47, ¬ white balance:cloudy}
end tell
Adobe Photoshop CS2
AppleScript Scripting Reference AppleScript Objects 30

change mode options

Options that can be supplied when changing a document’s mode using the change mode command. See
change mode for additional details.
The following classes inherit properties from the change mode options class: Bitmap mode options,
indexed mode options.
Valid Commands
change mode
Loading...
+ 221 hidden pages