Macromedia Photoshop - CS5 User Guide

ADOBE PHOTOSHOP CS5
APPLESCRIPT SCRIPTING REFERENCE
bbc
© 2010 Adobe Systems Incorporated. All rights reserved.
Adobe® Creative Suite® 5 Photoshop
®
AppleScript Scripting Reference for 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.
®
, the Adobe logo, Acrobat®, Illustrator®, and Photoshop® are either registered trademarks or trademarks of Adobe Systems
Adobe Incorporated in the United States and/or other countries.
Apple®, Mac OS®, 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. JavaScriptTM 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—CS5 Changes................................................................................................................... 8
............................................................................................................................................................................................................... 8
2 AppleScript Objects..................................................................................................................... 9
add noise .........................................................................................................................................................................................10
adjustment options .....................................................................................................................................................................11
application......................................................................................................................................................................................12
art layer, art layers ........................................................................................................................................................................15
automatic contrast.......................................................................................................................................................................18
automatic levels............................................................................................................................................................................19
average.............................................................................................................................................................................................20
batch options.................................................................................................................................................................................21
Bitmap mode options.................................................................................................................................................................23
blur.....................................................................................................................................................................................................24
blur more.........................................................................................................................................................................................25
BMP save options .........................................................................................................................................................................26
brightness and contrast.............................................................................................................................................................28
Camera RAW open options.......................................................................................................................................................29
change mode options ................................................................................................................................................................31
channel, channels.........................................................................................................................................................................32
clouds ...............................................................................................................................................................................................34
CMYK color......................................................................................................................................................................................35
color balance..................................................................................................................................................................................36
color sampler, color samplers..................................................................................................................................................37
color value.......................................................................................................................................................................................38
contact sheet options.................................................................................................................................................................39
count item, count items.............................................................................................................................................................41
curves................................................................................................................................................................................................42
custom filter ...................................................................................................................................................................................43
deinterlace......................................................................................................................................................................................44
desaturate .......................................................................................................................................................................................45
despeckle ........................................................................................................................................................................................46
DICOM open options ..................................................................................................................................................................47
difference clouds..........................................................................................................................................................................48
diffuse glow....................................................................................................................................................................................49
displace filter..................................................................................................................................................................................50
document, documents...............................................................................................................................................................51
dust and scratches .......................................................................................................................................................................55
EPS open options .........................................................................................................................................................................56
EPS save options...........................................................................................................................................................................57
equalize............................................................................................................................................................................................59
export options...............................................................................................................................................................................60
filter options...................................................................................................................................................................................61
font, fonts........................................................................................................................................................................................62
gallery banner options ...............................................................................................................................................................63
3
Adobe Photoshop CS5
AppleScript Scripting Reference 4
gallery color options ...................................................................................................................................................................64
gallery images options ...............................................................................................................................................................65
gallery options...............................................................................................................................................................................67
gallery security options..............................................................................................................................................................68
gallery thumbnail options.........................................................................................................................................................69
gaussian blur..................................................................................................................................................................................70
GIF save options............................................................................................................................................................................71
glass filter ........................................................................................................................................................................................73
gray color.........................................................................................................................................................................................74
high pass..........................................................................................................................................................................................75
history state, history states .......................................................................................................................................................76
HSB color .........................................................................................................................................................................................77
Illustrator paths export options ..............................................................................................................................................78
indexed mode options ...............................................................................................................................................................79
info-object.......................................................................................................................................................................................81
inversion ..........................................................................................................................................................................................83
JPEG save options ........................................................................................................................................................................84
Lab color ..........................................................................................................................................................................................85
layer, layers .....................................................................................................................................................................................86
layer comp, layer comps............................................................................................................................................................88
layer set, layer sets .......................................................................................................................................................................89
lens blur ...........................................................................................................................................................................................92
lens flare...........................................................................................................................................................................................94
levels adjustment .........................................................................................................................................................................95
maximum filter..............................................................................................................................................................................96
measurement scale......................................................................................................................................................................97
median noise..................................................................................................................................................................................98
minimum filter...............................................................................................................................................................................99
mix channels ............................................................................................................................................................................... 100
motion blur.................................................................................................................................................................................. 101
no color ......................................................................................................................................................................................... 102
notifier, notifiers......................................................................................................................................................................... 103
NTSC colors.................................................................................................................................................................................. 104
ocean ripple................................................................................................................................................................................. 105
offset filter.................................................................................................................................................................................... 106
open options............................................................................................................................................................................... 107
path item, path items............................................................................................................................................................... 108
path point, path points ........................................................................................................................................................... 110
path point info............................................................................................................................................................................ 111
PDF open options...................................................................................................................................................................... 112
PDF save options ....................................................................................................................................................................... 114
Photo CD open options........................................................................................................................................................... 117
photo filter................................................................................................................................................................................... 118
Photoshop DCS 1.0 save options......................................................................................................................................... 119
Photoshop DCS 2.0 save options......................................................................................................................................... 121
Photoshop save options ......................................................................................................................................................... 123
PICT file save options ............................................................................................................................................................... 124
PICT resource save options.................................................................................................................................................... 125
picture package options......................................................................................................................................................... 126
pinch .............................................................................................................................................................................................. 128
Pixar save options .............................................................................................................
........................................................ 129
Adobe Photoshop CS5
AppleScript Scripting Reference 5
PNG save options ...................................................................................................................................................................... 130
polar coordinates ...................................................................................................................................................................... 131
posterize ....................................................................................................................................................................................... 132
presentation options................................................................................................................................................................ 133
radial blur ..................................................................................................................................................................................... 135
raw format open options........................................................................................................................................................ 136
raw save options........................................................................................................................................................................ 137
RGB color ...................................................................................................................................................................................... 138
RGB hex color.............................................................................................................................................................................. 139
ripple.............................................................................................................................................................................................. 140
save for web export options.................................................................................................................................................. 141
save options ................................................................................................................................................................................ 143
selection-object ......................................................................................................................................................................... 144
selective color............................................................................................................................................................................. 145
settings-object ........................................................................................................................................................................... 146
SGI RGB save options ............................................................................................................................................................... 150
sharpen ......................................................................................................................................................................................... 151
sharpen edges ............................................................................................................................................................................ 152
sharpen more.............................................................................................................................................................................. 153
shear............................................................................................................................................................................................... 154
smart blur..................................................................................................................................................................................... 155
spherize......................................................................................................................................................................................... 156
sub path info............................................................................................................................................................................... 157
sub path item, sub path items.............................................................................................................................................. 158
Targa save options.................................................................................................................................................................... 159
text-object.................................................................................................................................................................................... 160
texture fill ..................................................................................................................................................................................... 168
threshold adjustment .............................................................................................................................................................. 169
TIFF save options....................................................................................................................................................................... 170
twirl................................................................................................................................................................................................. 172
unsharp mask.............................................................................................................................................................................. 173
wave filter..................................................................................................................................................................................... 174
XMP metadata ............................................................................................................................................................................ 175
zigzag............................................................................................................................................................................................. 176
3 AppleScript Commands .......................................................................................................... 177
Overview....................................................................................................................................................................................... 177
activate.......................................................................................................................................................................................... 178
adjust ............................................................................................................................................................................................. 179
apply .............................................................................................................................................................................................. 180
apply layer style ......................................................................................................................................................................... 181
auto count.................................................................................................................................................................................... 182
batch .............................................................................................................................................................................................. 183
change mode.............................................................................................................................................................................. 184
close ............................................................................................................................................................................................... 185
clear................................................................................................................................................................................................ 186
contract......................................................................................................................................................................................... 187
convert .......................................................................................................................................................................................... 188
convert color............................................................................................................................................................................... 188
convert to shape........................................................................................................................................................................ 188
copy................................................................................................................................................................................................ 189
Adobe Photoshop CS5
AppleScript Scripting Reference 6
copy merged............................................................................................................................................................................... 189
count.............................................................................................................................................................................................. 190
create contact sheet................................................................................................................................................................. 191
create PDF presentation ......................................................................................................................................................... 191
create photo gallery ................................................................................................................................................................. 191
create photo merge.................................................................................................................................................................. 191
create picture package............................................................................................................................................................ 192
create selection.......................................................................................................................................................................... 193
create work path........................................................................................................................................................................ 193
crop................................................................................................................................................................................................. 194
cut ................................................................................................................................................................................................... 195
delete............................................................................................................................................................................................. 196
delete measurements.............................................................................................................................................................. 197
deselect......................................................................................................................................................................................... 198
deselect......................................................................................................................................................................................... 198
do action....................................................................................................................................................................................... 199
do javascript................................................................................................................................................................................ 200
doc duplicate .............................................................................................................................................................................. 201
duplicate....................................................................................................................................................................................... 201
duplicate....................................................................................................................................................................................... 202
equal colors ................................................................................................................................................................................. 203
exists .............................................................................................................................................................................................. 204
expand........................................................................................................................................................................................... 205
export ............................................................................................................................................................................................ 206
export measurements ............................................................................................................................................................. 207
feather ........................................................................................................................................................................................... 208
feature enabled.......................................................................................................................................................................... 209
fill..................................................................................................................................................................................................... 210
fill path .......................................................................................................................................................................................... 210
filter ................................................................................................................................................................................................ 212
flatten ............................................................................................................................................................................................ 213
flip canvas .................................................................................................................................................................................... 214
grow ............................................................................................................................................................................................... 215
import annotations................................................................................................................................................................... 216
index .............................................................................................................................................................................................. 217
invert.............................................................................................................................................................................................. 218
link .................................................................................................................................................................................................. 219
load................................................................................................................................................................................................. 220
load................................................................................................................................................................................................. 220
make............................................................................................................................................................................................... 221
make clipping path................................................................................................................................................................... 222
make work path ......................................................................................................................................................................... 222
merge............................................................................................................................................................................................. 223
merge visible layers.................................................................................................................................................................. 223
move .............................................................................................................................................................................................. 224
open ............................................................................................................................................................................................... 225
paste............................................................................................................................................................................................... 226
Photoshop open dialog .......................................................................................................................................................... 227
print................................................................................................................................................................................................ 228
purge.............................................................................................................................................................................................. 229
quit...........................................................................................................................
....................................................................... 230
Adobe Photoshop CS5
AppleScript Scripting Reference 7
rasterize......................................................................................................................................................................................... 231
recapture ...................................................................................................................................................................................... 232
record measurements.............................................................................................................................................................. 233
refresh............................................................................................................................................................................................ 234
reset from comp ........................................................................................................................................................................ 235
resize canvas ............................................................................................................................................................................... 236
resize image................................................................................................................................................................................. 236
reveal all........................................................................................................................................................................................ 237
rotate ............................................................................................................................................................................................. 238
rotate boundary......................................................................................................................................................................... 238
rotate canvas............................................................................................................................................................................... 239
save................................................................................................................................................................................................. 240
scale................................................................................................................................................................................................ 243
scale boundary........................................................................................................................................................................... 243
select.............................................................................................................................................................................................. 244
select.............................................................................................................................................................................................. 244
select all ........................................................................................................................................................................................ 245
select border ............................................................................................................................................................................... 245
similar ............................................................................................................................................................................................ 246
smooth .......................................................................................................................................................................................... 247
split channels .............................................................................................................................................................................. 248
store................................................................................................................................................................................................ 249
stroke ............................................................................................................................................................................................. 250
stroke path................................................................................................................................................................................... 250
translate ........................................................................................................................................................................................ 252
translate boundary ................................................................................................................................................................... 253
trap ................................................................................................................................................................................................. 254
trim ................................................................................................................................................................................................. 255
unlink ............................................................................................................................................................................................. 256
web safe color............................................................................................................................................................................. 257
Appendix A: Event ID Codes ................................................................................................... 258
Index .........................................................................................................................................266
1

Introduction

This reference describes the objects and commands in the Adobe® Photoshop® CS5 AppleScript dictionary. A companion document, Adobe Photoshop CS5, 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 CS5, and lists changes to the
AppleScript interface since the previous release.
AppleScript Objects, which provides a complete reference for all AppleScript Photoshop DOM objects.
AppleScript Commands, which provides a complete refernce for all AppleScript Photoshop DOM
commands.

Changes Since Earlier Versions—CS5 Changes

The following changes have been made to the AppleScript object model and language support in Adobe Photoshop CS5.
We have made major changes around printing a document. After making such sweeping changes, your printing scripts may not work in CS5. The new printing interface makes maintaining backwards compatibility an issue and scripts will need to be updated for the new printing interface. See the print command.
Two new blend modes:
Two new color blend modes: subtract and divide
subtract and divide
8
2

Elements

AppleScript Objects

The objects of the AppleScript dictionary for Adobe Photoshop CS5 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.
9
Adobe Photoshop CS5
AppleScript Scripting Reference AppleScript Objects 10

add noise

Options that may be supplied when applying an Add Noise filter.
The
add noise class supplies properties for the filter options class. The add noise class is used only
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
add noise
See the

Properties

Property Value Type What it is
amount
distribution
monochromatic
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).
tell application "Adobe Photoshop CS5"
end tell
filter command for additional details.
real
(amount: 0.1% - 400%)
Valid values:
Gaussian uniform
boolean
filter current layer of the current document using add noise ¬
with options {class:add noise, amount:2.5, distribution:uniform, ¬ monochromatic:false}
Adobe Photoshop CS5
AppleScript Scripting Reference AppleScript Objects 11

adjustment options

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

application

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

Elements

Elements Refer to by
document name, numeric index, as a range of elements, before/
font name, numeric index, as a range of elements, before/
notifier name, numeric index, as a range of elements, before/

Properties

Property Value type What it is
best type
class
default type
properties
background color
build
color settings
after another element, satisfying a test
after another element, satisfying a test
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
string or color object
The color for the document’s background color.
Read-only. Information about the application build.
The name of selected color setting’s set.
current document
display dialogs
foreground color
free memory
frontmost
locale
macintosh file types
measurement log
document
Valid Values:
always error dialogs never
color value
real
boolean
string
list of Unicode text
measurement log
The frontmost document.
Controls whether and dialogs are displayed while the script is running.
The default foreground color (used to fill and stroke selections).
Read-only. The amount of unused memory available to Adobe Adobe Photoshop CS5.
Read-only. Indicates whether Adobe Photoshop CS5 is the frontmost application.
Read-only. The language location of the application.
Read-only. A list of file image types Adobe Photoshop CS5 can open.
The log of measurements taken.
Adobe Photoshop CS5
AppleScript Scripting Reference AppleScript Objects 13
Property Value type What it is (Continued)
name
notifiers enabled
preferences folder
recent files
scripting build date
scripting version
settings
system information
windows file types
version
Unicode text
boolean
alias
list of file specification
Unicode text
Unicode text
settings-object
string
list of Unicode text
Unicode text
Read-only. The application's name.
TIndicates whether all notifiers are enabled or disabled..
Read-only. The full path to the Preferences folder.
Read-only. Files in the Recent Files list.
Read-only. The build date of the scripting interface .
Read-only. The scripting interface version.
Read-only. The application preference settings (equivalent to selecting Edit > Preferences in the
®
Adobe Photoshop CS5 application in Windows
®
Photoshop > Preferences in Mac OS
).
or
Read-only. Runtime details of the application and system.
Read-only. A list of file image types Adobe Photoshop CS5 can open.
Read-only. The Adobe Photoshop version.
The the first line of the following code sample directs Adobe Photoshop CS5 to carry out the script’s commands. The second line uses the
activate command to make Adobe Photoshop CS5 the frontmost
application.
tell application "Adobe Photoshop CS5"
activate set fgColor to foreground color set bgColor to background color set foreground color to {class:RGB color, red:255, green:128, blue:128} set background color to {class:RGB color, red:0, green:50, blue:255} delay 1 set foreground color to fgColor set background color to bgColor tell me to activate my dd("name:" & name) my dd("locale:" & locale) my dd("scripting version:" & scripting version) my dd("scripting build date:" & scripting build date) my dd("macintosh file types:" & macintosh file types) my dd("windows file types:" & windows file types)
end tell
on dd(msg)
display dialog msg giving up after 1
end dd
Valid Commands
activate
Adobe Photoshop CS5
AppleScript Scripting Reference AppleScript Objects 14
purge quit refresh
Adobe Photoshop CS5
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
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 darker color difference dissolve divide exclusion hard light hard mix hue blend lighten lighter color linear burn linear dodge linear light luminosity multiply normal overlay pass through pin light saturation blend screen soft light subtract 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.
(Inherited from the layer class) All of this object’s properties returned in a single record.
(Inherited from the layer class) Indicates whether all of the layer’s contents are locked or editable.
(Inherited from the layer class) The mode used when compositing an object.
Adobe Photoshop CS5
AppleScript Scripting Reference AppleScript Objects 16
Property Value Type What it is (Continued)
bounds
container
linked layers
name
opacity
visible
background layer
fill opacity
grouped
list of real
reference
list of layers
Unicode text
real
boolean
boolean
real
boolean
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.
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) Indicates whether the layer is visible.
Indicates whether the layer is a background layer.
The layer’s interior opacity (0.0 - 100.0).
Indicates whether the layer is grouped with the layer below.
kind
pixels locked
Valid Values:
blank and white layer brightness contrast layer channel mixer layer color balance layer curves layer exposure layer gradient fill layer gradient map layer hue saturation layer inversion layer levels layer normal pattern fill layer photo filter layer posterize layer smart object layer selective color layer solid fill layer text layer threeD layer threshold layer vibrance layer video layer
boolean
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.
Indicates whether the pixels in the layer’s image can be edited using the paintbrush tool.
position locked
boolean
Indicates whether the pixels in the layer’s image can be moved within the layer.
Adobe Photoshop CS5
AppleScript Scripting Reference AppleScript Objects 17
Property Value Type What it is (Continued)
text object
transparent pixels locked
Valid Commands
adjust apply layer style clear copy copy merged count cut delete duplicate exists filter index link make merge move rasterize rotate scale translate unlink
text-object
boolean
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.
The following code creates a text layer by creating an art layer and setting its kind property to text
.
layer
tell application "Adobe Photoshop CS5"
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 CS5
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 CS5 application, is used only to define a record containing properties that specify options when using the
contrast
create an
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.
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).
tell application "Adobe Photoshop CS5"
adjust current layer of the current document using automatic contrast
end tell
Adobe Photoshop CS5
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 CS5 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.
adjust command. It is not possible to get or create an automatic
See the
adjust command for additional details.
The following code sample demonstrates how to apply an Automatic Levels adjustment using the command of the
tell application "Adobe Photoshop CS5"
adjust current layer of the current document using automatic levels
end tell
automatic levels class (inherited from the adjustment options super class).
adjust
Adobe Photoshop CS5
AppleScript Scripting Reference AppleScript Objects 20

average

Options that may be supplied when applying an Average filter.
The
average class supplies properties for the filter options class. The average class is used only to
define a record when using the supplied only in conjunction with the object.
filter command to apply an Average filter. average options can be
filter command. It is not possible to get or create an average
See the
filter command for additional details.
The following code sample demonstrates how to apply the average filter using the filter command of the
average class (inherited from the filter options super class).
tell application "Adobe Photoshop CS5"
filter current layer of the current document using average
end tell
Adobe Photoshop CS5
AppleScript Scripting Reference AppleScript Objects 21

batch options

Options to specify when running a Batch command. See batch.

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 document name lower document name mixed document name upper extension lower extension upper mmdd mmddyy serial letter lower serial letter upper serial number one serial number two serial number three serial number four 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.
macintosh compatible
override open
boolean
boolean
Indicates whether to make the final file nameS Macintosh compatible (default:
Note: Valid only when
destination.
See
destination:folder.
true).
Indicates whether to override action open commands (default:
false).
Adobe Photoshop CS5
AppleScript Scripting Reference AppleScript Objects 22
Property Value type What it is (Continued)
override save
starting serial
suppress open
suppress profile
unix compatible
windows compatible
boolean
number (long)
boolean
boolean
boolean
boolean
Indicates whether to override save as action steps with the specified destination (default:
Note: Valid only when
destination:save and close
destination.
See
destination:folder or
false).
.
The starting serial number to use in naming files (default:
Note: Valid only when
1).
destination.
See
destination:folder.
Indicates whether to suppress the file open options dialogs (default:
false).
Indicates whether to suppress the color profile warnings (default:
false).
Indicates whether to make the final file name Unix compatible (default:
Note: Valid only when
destination.
See
true).
destination:folder.
Indicates whether to make the final file names Windows compatible (default:
true).
Note: Valid only when
destination.
See
destination:folder.
Adobe Photoshop CS5
AppleScript Scripting Reference AppleScript Objects 23

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 that 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
real
Valid Values:
custom pattern diffusion dither halftone screen conversion middle threshold pattern dither
real
Unicode text
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
.
For information about pre-installed valid patterns, see Adobe Photoshop CS5 Help on the bitmap conversion command, or view the options availabe in the Custom Color drop down box after choosing the bitmap conversion command.
resolution
screen shape
real
Valid values:
halftone cross halftone diamond halftone ellipse halftone line halftone round halftone square
The output resolution (in pixels per inch) (default:
72.0).
The dot shape to use.
Note: Valid only when
method: halftone screen
conversion
.
Adobe Photoshop CS5
AppleScript Scripting Reference AppleScript Objects 24

blur

Options that may be supplied when applying a Blur filter.
The
blur class supplies properties for the filter options class. The blur class is used only to define a
record when using the conjunction with the
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.
See the
filter command for additional details.
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).
tell application "Adobe Photoshop CS5"
filter current layer of the current document using blur
end tell
blur
Adobe Photoshop CS5
AppleScript Scripting Reference AppleScript Objects 25

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.
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
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).
tell application "Adobe Photoshop CS5"
filter current layer of the current document using blur more
end tell
Adobe Photoshop CS5
AppleScript Scripting Reference AppleScript Objects 26

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
).
Indicates whether to write the image from top to bottom (default:
Note: Available only when
system: windows
system.
false).
target operating
. See target operating
Indicates 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
Indicates whether to save the alpha channels.
The target OS (default: Windows).
Adobe Photoshop CS5
AppleScript Scripting Reference AppleScript Objects 27
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.
tell application "Adobe Photoshop CS5"
make new document set myFile to "Data:docsamples:testfiles:BmpTest.bmp" set myOptions to {class:BMP save options, bits per sample:sixteen, ¬
flipped row order:false, RLE compression:true, save alpha channels:true,¬ target operating system:Windows}
save current document in file myFile as BMP with options ¬
myOptions appending no extension without copying
end tell
Adobe Photoshop CS5
AppleScript Scripting Reference AppleScript Objects 28

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 CS5 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.
brightness and contrast
See the

Properties

Property Value Type What it is
brightness level
contrast level
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).
tell application "Adobe Photoshop CS5"
end tell
adjust command for additional details.
integer
integer
adjust current layer of the current document using brightness and contrast ¬
with options {class:brightness and contrast, brightness level:10, ¬ contrast level:10}
(-100 - 100)
(-100 - 100)
Adobe Photoshop CS5
AppleScript Scripting Reference AppleScript Objects 29

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.
bits per channel
blue hue
blue saturation
brightness
chromatic aberration by
chromatic aberration rc
color noise reduction
color space
contrast
Valid values:
eight one sixteen thirty two
integer
integer
integer
integer
integer
integer
Valid values:
Adobe RGB color match RGB ProPhoto Rgb 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
green hue
green saturation
luminance smoothing
red hue
red saturation
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 CS5
AppleScript Scripting Reference AppleScript Objects 30
Property Value type What it is (Continued)
settings
shadows
shadow tint
sharpness
size
temperature
tint
vignetting amount
vignetting midpoint
Valid values:
camera default custom settings selected image
integer
integer
integer
Valid values:
extra large large maximum medium minimum small
integer
integer
integer
integer
The global settings for all Camera RAW options.
Default value:
camera default.
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.
extra large=5120 x 3413 large=4096 x 2731 maximum=6144 x 4096 medium=3072 x 2048 minimum=1536 x 1024 small=2048 x 1365
The temperature of the shot (2000 - 50000).
The tint of the shot (-150 - 150).
The vignetting amount of the shot (-100 - 100).
The vignetting mid point of the shot (-100 -
100).
white balance
The following code opens a camera raw document.
Valid values:
as shot auto cloudy custom camera settings daylight flash fluorescent shade tungston
tell application "Adobe Photoshop CS5"
set myFilePath to alias "Data:docsamples:testfiles:CanonG1.CRW" open myFilePath as Camera RAW with options ¬
{class:Camera RAW open options, bits per channel:eight, ¬ color noise reduction:20, temperature:4200, white balance:cloudy}
end tell
The white balance options for the image.
Loading...
+ 241 hidden pages