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.
art layer, art layers ........................................................................................................................................................................15
BMP save options .........................................................................................................................................................................26
brightness and contrast.............................................................................................................................................................28
Camera RAW open options.......................................................................................................................................................29
color balance..................................................................................................................................................................................36
color sampler, color samplers..................................................................................................................................................37
color value.......................................................................................................................................................................................38
DICOM open options ..................................................................................................................................................................47
dust and scratches .......................................................................................................................................................................55
EPS open options .........................................................................................................................................................................56
EPS save options...........................................................................................................................................................................57
gallery color options ...................................................................................................................................................................64
GIF save options............................................................................................................................................................................71
high pass..........................................................................................................................................................................................75
history state, history states .......................................................................................................................................................76
HSB color .........................................................................................................................................................................................77
JPEG save options ........................................................................................................................................................................84
Lab color ..........................................................................................................................................................................................85
maximum filter..............................................................................................................................................................................96
median noise..................................................................................................................................................................................98
no color ......................................................................................................................................................................................... 102
open options............................................................................................................................................................................... 107
path point, path points ........................................................................................................................................................... 110
path point info............................................................................................................................................................................ 111
PDF open options...................................................................................................................................................................... 112
PDF save options ....................................................................................................................................................................... 114
Photo CD open options........................................................................................................................................................... 117
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
PNG save options ...................................................................................................................................................................... 130
raw format open options........................................................................................................................................................ 136
raw save options........................................................................................................................................................................ 137
RGB color ...................................................................................................................................................................................... 138
save for web export options.................................................................................................................................................. 141
save options ................................................................................................................................................................................ 143
sub path info............................................................................................................................................................................... 157
sub path item, sub path items.............................................................................................................................................. 158
Targa save options.................................................................................................................................................................... 159
texture fill ..................................................................................................................................................................................... 168
TIFF save options....................................................................................................................................................................... 170
auto count.................................................................................................................................................................................... 182
close ............................................................................................................................................................................................... 185
convert to shape........................................................................................................................................................................ 188
create PDF presentation ......................................................................................................................................................... 191
create work path........................................................................................................................................................................ 193
do action....................................................................................................................................................................................... 199
do javascript................................................................................................................................................................................ 200
fill path .......................................................................................................................................................................................... 210
index .............................................................................................................................................................................................. 217
link .................................................................................................................................................................................................. 219
make clipping path................................................................................................................................................................... 222
make work path ......................................................................................................................................................................... 222
open ............................................................................................................................................................................................... 225
Photoshop open dialog .......................................................................................................................................................... 227
record measurements.............................................................................................................................................................. 233
reset from comp ........................................................................................................................................................................ 235
select all ........................................................................................................................................................................................ 245
similar ............................................................................................................................................................................................ 246
trim ................................................................................................................................................................................................. 255
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.
ElementRefer to by
channel
Properties
PropertyValue TypeWhat 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.
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
PropertyValue TypeWhat 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}
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)
Any layer that can contain data. The art layer class inherits properties from the layer, layers class.
Properties
PropertyValue TypeWhat 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.
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
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).
Options to specify when running a Batch command. See batch.
Properties
PropertyValue typeWhat 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:
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
PropertiesValue TypeWhat it is
bitmap mode class inherits properties from the change mode optionsclass.
Bitmap mode options can only be supplied in conjunction with the change mode
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.
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
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
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, ¬
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
PropertyValue TypeWhat 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}
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
PropertyValue typeWhat 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).