Advertisement

Scripting Guide
b b
c

Advertisement

Table of Contents
loading

Summary of Contents for Adobe PHOTOSHOP CS 2.0 - SCRIPTING GUIDE

  • Page 1 Scripting Guide...
  • Page 2 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.
  • Page 3: Table Of Contents

    Contents Introduction ..........................1 About this manual..................................1 What is scripting? ................................... 2 Why use scripting? ..................................2 Why use scripts instead of Actions?............................2 System requirements..................................3 Choosing a scripting language ..............................4 New Features ....................................5 Scripting basics ..........................6 Introducing Objects..................................
  • Page 4 Adobe Illustrator CS2 Visual Basic Scripting Reference Contents Sample Workflow Automation JavaScripts.........................71 Advanced Scripting ..................................72 Index ............................85...
  • Page 5: Introduction

    About this manual ® ® ® ® This manual provides an introduction to scripting Adobe Photoshop CS2 on Mac OS and Windows Chapter one covers the basic conventions used in this manual and provides an overview of requirements for scripting Photoshop CS2.
  • Page 6: What Is Scripting

    ” A single script can perform actions that involve multiple applications. For example, depending on the ● scripting language you are using, you could target both Photoshop CS2 and another Adobe Creative ® Suite 2 Application, such as Illustrator CS2, in the same script.
  • Page 7: System Requirements

    Photoshop CS2 Adobe Photoshop CS2 Scripting Guide Introduction You can copy scripts from one computer to another. If you were using an Action and then switched ● computers, you’d have to recreate the Action. Scripts provide more versatility for automatically opening files. When opening a file in an action, you ●...
  • Page 8: Choosing A Scripting Language

    Photoshop CS2 Adobe Photoshop CS2 Scripting Guide Introduction JavaScript You can write JavaScripts on either the Mac OS or Windows platform using any text editor. You must save JavaScript files as text files with a extension. .jsx For more information, see ‘Creating and Running a JavaScript’...
  • Page 9: New Features

    Photoshop CS2 Adobe Photoshop CS2 Scripting Guide Introduction Scripts that control multiple applications You can write scripts in either AppleScript or VBScript that control multiple applications. For example, on a Macintosh you can write an AppleScript that first manipulates a bitmap in Photoshop and then commands a web design application to incorporate it.
  • Page 10: Scripting Basics

    For example, a Channel object does not, obviously, have a command/method. print/PrintOut/print() How do you know which properties or commands/methods you can use? Adobe provides all the information you need in the following references, which are available on the installation CD: Adobe Photoshop CS2 AppleScript Scripting Reference...
  • Page 11: Writing Script Statements

    Photoshop CS2 Adobe Photoshop CS2 Scripting Guide Scripting basics Adobe Photoshop CS2 Visual Basic Scripting Reference ● Adobe Photoshop CS2 JavaScript Scripting Reference ● Tip: Throughout this guide, explanations of how to create a script for a task are followed by instructions for looking up in the appropriate scripting reference the specific elements used in the script.
  • Page 12: Photoshop Cs2'S Object Model

    Photoshop CS2 Adobe Photoshop CS2 Scripting Guide Scripting basics To get the script to open that window, you’d simply add the command or method for opening it. Thus your scripting statement would look like this: In my house, in the living room, the window on the north wall: open it.
  • Page 13: Object Elements And Collections

    Photoshop CS2 Adobe Photoshop CS2 Scripting Guide Scripting basics The following table provides information about each object. To create this object without Object Name Description using a script: Application The Photoshop CS2 application Start the Photoshop CS2 application. Document The working object, in which you create layers, In Photoshop CS2, choose channels, actions, and so on.
  • Page 14 Photoshop CS2 Adobe Photoshop CS2 Scripting Guide Scripting basics Note: Your scripts place objects in elements or collections even when there is only one object of that type in the entire script, that is, only one object in the element or collection.
  • Page 15: Object References

    Photoshop CS2 Adobe Photoshop CS2 Scripting Guide Scripting basics In AppleScript, you use the object type name followed by a space and then the index. The following statement refers to the current document. Notice that the element name is implied rather than used explicitly.
  • Page 16: Using Commands And Methods

    Before using a method on a VBScript or JavaScript object, look up the method in the Methods ● table for the object type in the Adobe Photoshop CS2 Visual Basic Scripting Reference or the Adobe Photoshop CS2 JavaScript Scripting Reference.
  • Page 17: Using Variables

    The enumerated value at the end of the script statement indicates the value psNewBitmap the constant . The Adobe Photoshop CS2 Visual Basic Scripting Reference PsNewDocumentMode contains detailed information about enumerated values and constants. app.documents.add(4000, 5000, 72, "myDocument", DocumentMode.BITMAP) Using Variables A variable is a container for data you use in your script.
  • Page 18 Photoshop CS2 Adobe Photoshop CS2 Scripting Guide Scripting basics Why Use Variables? There are several reasons for using variables rather than entering values directly in the script. Variables make your script easier to update or change. For example, if your script creates several 4 x 2 ●...
  • Page 19 Photoshop CS2 Adobe Photoshop CS2 Scripting Guide Scripting basics Using the Variable in a Script After declaring and assigning values to your variables, you use the variables in your script to represent the value; you use only the variable name without the command.
  • Page 20 Photoshop CS2 Adobe Photoshop CS2 Scripting Guide Scripting basics To assign a value to a variable, you use the equals sign (=), as follows: thisNumber = 10 thisString = "Hello, World" Note: Remember to enclose string values in straight, double quotes ("").
  • Page 21 Photoshop CS2 Adobe Photoshop CS2 Scripting Guide Scripting basics Value Type What It Is Example (Continued) Properties and methods activeDocument Object belonging to an object or Documents(1).ArtLayers(2) array A series of text characters. "Hello" String Strings appear inside "123 Main St."...
  • Page 22: Using Object Properties

    Photoshop CS2 Adobe Photoshop CS2 Scripting Guide Scripting basics script a year after you write it, such as . You can also give your variable names a standard prefix so that they’ll stand out from the objects, commands, and keywords of your scripting system. For example, you could use the prefix “doc”...
  • Page 23: Understanding Object Classes And Inheritance

    For example, look up the object in the “Interface” chapter of any of the following references Art Layer on the installation CD: Adobe Photoshop CS2 Visual Basic Scripting Reference ● Adobe Photoshop CS2 JavaScript Scripting Reference ● In the Properties table, look up .
  • Page 24: Documenting Scripts

    Photoshop CS2 Adobe Photoshop CS2 Scripting Guide Scripting basics myFiles[1] = “clouds.gif” myFiles[2] = “clouds.jpg” myFiles[3] = “clouds.pdf” Notice that each value is numbered. To use a value in a statement, you must include the number. The following statement opens the file clouds.gif...
  • Page 25: Using Long Script Lines

    Photoshop CS2 Adobe Photoshop CS2 Scripting Guide Scripting basics Note: Generally, your scripts are easier to read if you format all comments as single-line comments because the comment status of the line is indicated at the beginning of the line.
  • Page 26 Photoshop CS2 Adobe Photoshop CS2 Scripting Guide Scripting basics ➤ Our Hello World scripts will do the following: 1. Open the Photoshop CS2 application. 2. Create a new object. Document When we create the document, we will also create a variable named...
  • Page 27 Photoshop CS2 Adobe Photoshop CS2 Scripting Guide Scripting basics Note: The lines preceded by “--” are comments. Entering the comments is optional. -- Sample script to create a new text item and -- change its contents. --target Photoshop CS2 tell application "Adobe Photoshop CS2"...
  • Page 28 Photoshop CS2 #target application and create the ability to open JavaScripts that manipulate Photoshop CS2 from anywhere in your file system. See the “Script UI” chapter of the Adobe Photoshop CS2 JavaScript Scripting Reference for more information. ➤...
  • Page 29: Using Operators

    Photoshop CS2 Adobe Photoshop CS2 Scripting Guide Scripting basics 3. Do either of the following: If Photoshop CS2 is already open, choose File > Scripts > Browse, and then navigate to the Presets ● > Scripts folder and choose your script.
  • Page 30: Using Conditional Statements

    Photoshop CS2 Adobe Photoshop CS2 Scripting Guide Scripting basics Using Conditional Statements Conditional statements give your scripts a way to evaluate something and then act according to the result. For example, you may want your script to detect the blend mode of a layer or the name or date of a history state.
  • Page 31 Photoshop CS2 Adobe Photoshop CS2 Scripting Guide Scripting basics Set counter to 1 repeat with counter from 1 to 3 display dialog counter end repeat In VBScript, this type of loop is called a For-Next loop. Dim counter As Integer...
  • Page 32 Photoshop CS2 Adobe Photoshop CS2 Scripting Guide Scripting basics 3. When the user clicks OK (for “Please quit!”), the script displays a different dialog that asks if the user is sure they want to quit. 4. When the user clicks Cancel in the new dialog, they see the second dialog again.
  • Page 33: Using Subroutines, Handlers And Functions

    Photoshop CS2 Adobe Photoshop CS2 Scripting Guide Scripting basics /*create a confirm dialog with the text Quit? and two response buttons change the value of flag to the selected response*/ flag = confirm("Quit?") //change the value of flag back to false var flag = false flag = confirm("Are you sure?")
  • Page 34 Photoshop CS2 Adobe Photoshop CS2 Scripting Guide Scripting basics on DoConfirm(prompt) set button to button returned of (display dialog prompt ¬ buttons {"Yes", "No"} default button 1) return button = "Yes" end DoConfirm In VBScript, subroutines begin with the keyword and do not return a value.
  • Page 35: Executing Javascripts From As Or Vbs

    Photoshop CS2 Adobe Photoshop CS2 Scripting Guide Scripting basics Executing JavaScripts from AS or VBS You can take advantage of JavaScript’s platform-independence by running scripts from AppleScript or VBScript. You can execute either a single JavaScript statement or a complete JavaScript file.
  • Page 36: Testing And Troubleshooting

    Photoshop CS2 Adobe Photoshop CS2 Scripting Guide Scripting basics end tell Dim appRef As Photoshop.Application Set appRef = CreateObject("Photoshop.Application") appRef.DoJavaScriptFile "C:\\Applications\Scripts\JSFile.jsx", _ Array(1, "test text", appRef.ActiveDocument) When running JavaScript from AppleScript or VBScript you can also control the debugging state. To do this, use the argument.
  • Page 37 Check your VBScript documentation for more information. Windows Scripting Host also provides debugging information. JavaScript Debugging JavaScript debugging is described in detail in the Adobe Photoshop CS2 JavaScript Scripting Reference on the Photoshop installation CD. Please refer to that document for further information. Error Handling Imagine that you’ve written a script that formats the current text selection.
  • Page 38: Bibliography

    Photoshop CS2 Adobe Photoshop CS2 Scripting Guide Scripting basics Private Sub Command1_Click() ' Store a reference to the document with the name "My Document" ' If the document does not exist, display an error message. Dim appRef As New Photoshop.Application Dim docRef As Photoshop.Document...
  • Page 39 For further information and instruction in using the JavaScript scripting language, see these documents and resources: “JavaScript: The Definitive Guide," David Flanagan, O’Reily Media Inc, 2002. ISBN 0-596-00048-0. ● “JavaScript Bible," Danny Goodman, Hungry Minds Inc, 2001. ISBN 0-7645-4718-6. ● “Adobe Scripting, ” Chandler McWilliams, Wiley Publishing, Inc., 2003. ISBN 0-7645-2455-0. ●...
  • Page 40: Scripting Photoshop Cs2

    Note: The Photoshop CS2 dictionary does not display the complete list of open and save formats. To view the complete lists, look up the following commands in the Adobe Photoshop CS2 AppleScript Scripting Reference: ●...
  • Page 41: Targeting And Referencing The Application Object

    To view the VBS object library: 1. Start Word, and then choose Tools > Macro > Visual Basic Editor. 2. Choose Tools > References., and then select the Adobe Photoshop CS2 Type Library check box and click OK. 3. Choose View > Object Browser.
  • Page 42 To find out which commands can be used with an object, look up the object or the object’s element ● name in the “Objects” chapter in the Adobe Photoshop CS2 AppleScript Scripting Reference and check the Valid Commands list. For example, look up “document” or “documents” to learn which commands can be used with objects.
  • Page 43: Setting The Active Object

    Document Document appRef.Documents(0).ArtLayers.Add() If you look up in the object in the Adobe Photoshop CS2 Visual Basic Scripting Reference, you will Document see that there is no method in the object’s Methods table. However, the method is available...
  • Page 44 , you will find they are properties of the object. Similarly, if you activeHistoryState Document search for document in the Adobe Photoshop CS2 AppleScript Scripting Reference, you will current find it is a property of the , and so on. Class application For sample scripts that set active objects, see the following sections.
  • Page 45 Properties table of the object in the “Interface” ActiveLayer Document chapter of the Adobe Photoshop CS2 Visual Basic Scripting Reference. docRef.activeLayer = docRef.layers["Layer 1"] Look up the property in the Properties table of the object in the “Interface”...
  • Page 46: Opening A Document

    Photoshop CS2 Adobe Photoshop CS2 Scripting Guide Scripting Photoshop CS2 docRef.ActiveChannels = theChannels Alternatively, select all component channels using the property of the ComponentChannels Document object: appRef.ActiveDocument.ActiveChannels= _ appRef.ActiveDocument.ComponentChannels Set the active channels to the first and third channel using a channel array: theChannels = new Array(docRef.channels[0], docRef.channels[2])
  • Page 47 In the Adobe Photoshop CS2 AppleScript Scripting Reference look up the ● Photo CD open options class or the EPS open objects class In the Adobe Photoshop CS2 Visual Basic Scripting Reference and the Adobe Photoshop CS2 JavaScript ● Scripting Reference, look up the objects. PhotoCDOpenOptions...
  • Page 48: Saving A Document

    .eps In the Adobe Photoshop CS2 AppleScript Scripting Reference, look up the ● Class EPS save options In the Adobe Photoshop CS2 Visual Basic Scripting Reference and Adobe Photoshop CS2 JavaScript ● Scripting Reference, look up EPSSaveOptions...
  • Page 49 Photoshop CS2 Adobe Photoshop CS2 Scripting Guide Scripting Photoshop CS2 Save Classes Save Options Pict Pict Photoshop JPEG File Resource Pixar TIFF DSC1 DSC2 Targa Note: It is important to note that the formats are not identical. See Open Save ‘Opening a...
  • Page 50: Setting Application Preferences

    Application appRef.Preferences.RulerUnits = 2 'for PsUnits --> 2 (psInches) appRef.Preferences.TypeUnits = 1 'for PsTypeUnits --> 1 (psPixels) In the Adobe Photoshop CS2 Visual Basic Scripting Reference, look up the object to view all of Preferences the settings properties you can use. Additionally, look up the object >...
  • Page 51: Working With The Photoshop Cs2 Object Model

    DisplayDialogs Application object in the script to get to the property. Application In the Adobe Photoshop CS2 Visual Basic Scripting Reference, look up the object property Application . You’ll see the value type for this property is the constant . In the...
  • Page 52 Photoshop CS2 Adobe Photoshop CS2 Scripting Guide Scripting Photoshop CS2 ● var fontstInstalled = app.fonts The amount of unused memory available to Adobe Photoshop CS2. ● The location of the Presets folder. ● Note: for information on the Presets ‘Creating and Running a JavaScript’ on page 24 folder.
  • Page 53 Photoshop CS2 Adobe Photoshop CS2 Scripting Guide Scripting Photoshop CS2 'this script sample assumes the ruler units have been set to inches docRef.ResizeImage 4,4 docRef.ResizeCanvas 4,4 docRef.Trim Type:=psTopLeftPixel, Top:=True, Left:=False, _ Bottom:=True, Right:=False 'the crop command uses unit values 'change the ruler units to pixels app.Preferences.RulerUnits = Photoshop.PsUnits.psPixels...
  • Page 54 Photoshop CS2 Adobe Photoshop CS2 Scripting Guide Scripting Photoshop CS2 Creating an ArtLayer Object The following examples demonstrate how to create an object filled with red at the beginning of ArtLayer the current document. tell application "Adobe Photoshop CS2" make new art layer at beginning of current document ¬...
  • Page 55 Photoshop CS2 Adobe Photoshop CS2 Scripting Guide Scripting Photoshop CS2 The following examples show how to create a object after the creating the first Layer Set ArtLayer object in the current document: tell application "Adobe Photoshop CS2" make new layer set after layer 1 of current document...
  • Page 56 Photoshop CS2 Adobe Photoshop CS2 Scripting Guide Scripting Photoshop CS2 Note: Unlike object references in JavaScript or VBScript, AppleScript object reference names do not remain constant. Refer to an AppleScript language guide or text book for information on referencing a file using either...
  • Page 57 The following examples set the Puzzle layer style to the layer named “L1. ” apply layer style art layer "L1" of current document using ¬ "Puzzle (Image)" Look up the command in the “Commands” chapter of the Adobe Photoshop CS2 apply layer style AppleScript Scripting Reference. docRef.ArtLayers("L1").ApplyStyle "Puzzle (Image)"...
  • Page 58 Adobe Photoshop CS2 Visual Basic ● kind TextItem ArtLayer Scripting Reference and the Adobe Photoshop CS2 JavaScript Scripting Reference. properties of the in the Adobe Photoshop CS2 ● kind text object Class art layer AppleScript Scripting Reference.
  • Page 59 In the Adobe Photoshop CS2 AppleScript Scripting Reference, look up the ● Class text-object properties and methods. In the Adobe Photoshop CS2 Visual Basic Scripting Reference and the Adobe Photoshop CS2 JavaScript ● Scripting Reference, look up the property of the object.
  • Page 60 Photoshop CS2 Adobe Photoshop CS2 Scripting Guide Scripting Photoshop CS2 In the Adobe Photoshop CS2 Visual Basic Scripting Reference and the Adobe Photoshop CS2 JavaScript ● Scripting Reference, look up selection in the Properties table for the object. Also, look up the...
  • Page 61 Photoshop CS2 Adobe Photoshop CS2 Scripting Guide Scripting Photoshop CS2 Stroking the Selection Border The following examples use the command/method of the stroke (Stroke/stroke()) Selection object to stroke the boundaries around the current selection and set the stroke color and width.
  • Page 62 Photoshop CS2 Adobe Photoshop CS2 Scripting Guide Scripting Photoshop CS2 selRef.Contract 5 selRef.Feather 5 var selRef = app.activeDocument.selection selRef.expand( 5 ) selRef.contract( 5 ) selRef.feather( 5 ) Filling a Selection You can fill a selection either with a color or a history state.
  • Page 63 Photoshop CS2 Adobe Photoshop CS2 Scripting Guide Scripting Photoshop CS2 Loading and Storing Selections You can store objects in, or load them from, objects.The following examples use the Selection Channel command/method of the object to store the current selection in a...
  • Page 64 In the Adobe Photoshop CS2 AppleScript Scripting Reference, look up the properties for the ● Class info-object In the Adobe Photoshop CS2 Visual Basic Scripting Reference and the Adobe Photoshop CS2 JavaScript ● Scripting Reference, look up the Properties table for the object.
  • Page 65 Photoshop CS2 Adobe Photoshop CS2 Scripting Guide Scripting Photoshop CS2 In a script, you can access a object’s history states using the object, which is a Document HistoryStates property of the object. You can use a object to reset a document to a previous...
  • Page 66 Photoshop CS2 Adobe Photoshop CS2 Scripting Guide Scripting Photoshop CS2 Note: This type of script corresponds to selecting Start Application in the Script Events Manager (File > Scripts > Script Events Manager) in the Photoshop CS2 application. Please refer to Photoshop CS2 Help for information on using the Script Events Manager.
  • Page 67: Working With Color Objects

    Photoshop CS2 Adobe Photoshop CS2 Scripting Guide Scripting Photoshop CS2 //line #1--it’s a straight line so the coordinates for anchor, left, and //right //for each point have the same coordinates var lineArray = new Array() lineArray[0] = new PathPointInfo lineArray[0].kind = PointKind.CORNERPOINT lineArray[0].anchor = Array(100, 100)
  • Page 68 CMYK equivalent. convert color get foreground color convert color foreground color to CMYK Look up the following in the Adobe Photoshop CS2 AppleScript Scripting Reference: In the “Objects” chapter, the property of the ● foreground color Class application In the “Commands”...
  • Page 69: Working With Filters

    Adobe Photoshop CS2 Scripting Guide Scripting Photoshop CS2 someColor.cmyk 'someColor.model = 2 indicates psColorModel --> 2 (psRGBModel) End If Look up the following in the Adobe Photoshop CS2 Visual Basic Scripting Reference: in the table of the SolidColor object ● model...
  • Page 70: Understanding Clipboard Interaction

    Action Manager from a JavaScript to run a filter. If you are using AppleScript, VBScript or VBScript, you can run the JavaScript from your script. Refer to the Adobe Photoshop CS2 JavaScript Scripting Reference for information on using the Action Manager. Also, see ‘Executing JavaScripts from AS or VBS’...
  • Page 71 Photoshop CS2 Adobe Photoshop CS2 Scripting Guide Scripting Photoshop CS2 Using the Copy and Paste Commands/Methods The following examples copy the contents an the background layer to the clipboard, create a new document, and then paste the clipboard contents to the new document. The scripts assume that there is a document already open in Photoshop CS2 and that the document has a background layer.
  • Page 72: Working With Units

    Photoshop CS2 Adobe Photoshop CS2 Scripting Guide Scripting Photoshop CS2 In VBScript, you must use the object’s method with the parameter. To ArtLayer Selection Copy Merge perform the merged copy, you must enter, or pass, the value , as in the following example.
  • Page 73 Photoshop CS2 Adobe Photoshop CS2 Scripting Guide Scripting Photoshop CS2 speaking, length values but are included because they are used extensively by Photoshop CS2 for many operations and values. AppleScript Unit Considerations AppleScript provides an additional way of working with unit values. You can provide values with an explicit unit type where unit values are used.
  • Page 74 Look up the class’s properties in the “Objects” chapter of the Adobe Photoshop CS2 AppleScript Scripting ● Reference. Look up the property in the object’s Properties table in the “Objects” chapter of the Adobe Photoshop ● CS2 Visual Basic Scripting Reference or the Adobe Photoshop CS2 JavaScript Scripting Reference.
  • Page 75: Sample Workflow Automation Javascripts

    Photoshop CS2 Adobe Photoshop CS2 Scripting Guide Scripting Photoshop CS2 AppleScript VBScript JavaScript (Continued) resize image Document.ResizeImage document.resizeImage (height, width) (Height, Width) (height, width) contract Selection.Contract selection.contract (by) (By) (by) expand Selection.Expand selection.expand (by) (By) (by) feather Selection.Feather selection.feather (by)
  • Page 76: Advanced Scripting

    Photoshop CS2 Adobe Photoshop CS2 Scripting Guide Scripting Photoshop CS2 your application directory. See for information on the Creating and Running a JavaScript folder. Presets/Scripts Script Name Description Saves layer comps as files. Layer Comps to Files.jsx Saves layer comps as a PDF presentation.
  • Page 77 Photoshop CS2 Adobe Photoshop CS2 Scripting Guide Scripting Photoshop CS2 Preference Set to What it does (Continued) units pixels Uses pixels as the unit of measurement for text (type) dialog modes never Suppresses the use of dialogs so that your script executes without the user being asked for input (such as clicking an OK button) at various stages of the process.
  • Page 78 Photoshop CS2 Adobe Photoshop CS2 Scripting Guide Scripting Photoshop CS2 --check to see whether any documents are open --if none are found, create a document --use the default document settings as its properties if (count of documents) is 0 then make new document with properties ¬...
  • Page 79 Photoshop CS2 Adobe Photoshop CS2 Scripting Guide Scripting Photoshop CS2 appRef.DisplayDialogs = 3 'for PsDialogModes --> 3 (psDisplayNoDialogs) docWidthInInches = 4 docHeightInInches = 2 resolution = 72 helloWorldStr = "Hello, World!" 'see if any documents are open 'if none, create one using document defaults If appRef.Documents.Count = 0 Then...
  • Page 80 Photoshop CS2 Adobe Photoshop CS2 Scripting Guide Scripting Photoshop CS2 if (app.documents.length == 0) app.documents.add(docWidthInInches, docHeightInInches, resolution) //restore beginning preferences app.preferences.rulerunits = startRulerUnits app.preferences.typeunits = startTypeUnits app.displayDialogs = startDisplayDialogs 2. Name the script and save it in the Scripts folder.
  • Page 81 2. Run the complete script. Be patient while Photoshop CS2 executes your commands one by one. 3. After viewing the document in Photoshop CS2, close the document without saving it. Note: Look up the following classes in the Adobe AppleScript Scripting Reference to see if you understand how you used them in this script: ●...
  • Page 82 3. After viewing the document in Photoshop CS2, close Photoshop CS2 without saving the document. Note: Look up the following classes in the Adobe JavaScript Scripting Reference “Object Reference” chapter to see if you understand how you used them in this script: ●...
  • Page 83 Photoshop CS2 Adobe Photoshop CS2 Scripting Guide Scripting Photoshop CS2 Apply a wave filter to the selection. ● Note: The wave is a truncated sine curve. Defining the Area of a Selection Object To define the area of a selection object, we will create an array of coordinates, or points specified in pixels within the document.
  • Page 84 3. After viewing the document in Photoshop CS2, close the document without saving it. 4. Save the script in the Script Editor. Note: Look up the following classes in the Adobe AppleScript Scripting Reference to see if you understand how you used them in this script: ●...
  • Page 85 3. After viewing the document in Photoshop CS2, close the document without saving it. 4. Save the script. Note: Look up the following classes in the Adobe VBScript Scripting Reference to see if you understand how you used them in this script: class ●...
  • Page 86 3. After viewing the document in Photoshop CS2, close Photoshop CS2 without saving the document. Note: Look up the following classes in the Adobe JavaScript Scripting Reference “Object Reference” chapter to see if you understand how you used them in this script: ●...
  • Page 87 Adobe Photoshop CS2 Scripting Guide Scripting Photoshop CS2 Note: Look up the in the Adobe AppleScript Scripting Reference to see if you motion blur class understand how you used it in this script: ➤ To apply a motionblur filter to HelloWorldDoc: 1.
  • Page 88 Photoshop CS2 Adobe Photoshop CS2 Scripting Guide Scripting Photoshop CS2 Note: Look up the class method in the Adobe JavaScript Scripting ArtLayer applyMotionBlur() Reference “Object Reference” chapter to see if you understand how you used it in this script:...
  • Page 89: Index

    64 comparing 65 defined 63 getting and converting 64 hex values 64 actions, vs. scripting 2 setting 64 Adobe Photoshop CS2 object model 8, 47 web safe 65 AppleScript working with 63 conventions 1 commands creating 22 conventions 1...
  • Page 90 47 indices 10 Object references 11, 47 inheritance 19 objects Also see individual objects 9 activating 39 Adobe Photoshop CS2 object model 8 JavaScript collections 9 conventions 1 creating in a script 37 executing from AppleScript 31 defined 6...
  • Page 91 Photoshop CS2 Adobe Photoshop CS2 Scripting Guide Index defined 68 stroking 77 setting 71 Text Item object creating 54 working with 54 text layers 54 saving documents 44 text value type 15 Script Editor texting 32 defined 3 troubleshooting 32...

This manual is also suitable for:

Photoshop cs2

Table of Contents