Scripting Guide
Page 2
...and may be used or copied in it is a registered trademark of Adobe Systems Incorporated. Adobe® Creative Suite® 3 Photoshop® Scripting Guide for particular purposes, and noninfringement of Adobe Systems Incorporated. Apple®, Mac OS®, and Macintosh® ...in the United States and other countries. JavaScriptTM and all warranties of Adobe Systems Incorporated in the United States and other countries. Adobe®, the Adobe logo, Illustrator®, and Photoshop® are either registered trademarks or trademarks of merchantability, fitness for ...
...and may be used or copied in it is a registered trademark of Adobe Systems Incorporated. Adobe® Creative Suite® 3 Photoshop® Scripting Guide for particular purposes, and noninfringement of Adobe Systems Incorporated. Apple®, Mac OS®, and Macintosh® ...in the United States and other countries. JavaScriptTM and all warranties of Adobe Systems Incorporated in the United States and other countries. Adobe®, the Adobe logo, Illustrator®, and Photoshop® are either registered trademarks or trademarks of merchantability, fitness for ...
Scripting Guide
Page 3
...Creating and Running a VBScript...16 Creating and Running a JavaScript ...17 3 Scripting Photoshop CS3 ...19 Viewing Photoshop CS3 Objects, Commands, and Methods 19 Viewing Photoshop CS3's AppleScript Dictionary...19 Viewing Photoshop CS3's Type Library (VBS)...20 Targeting and Referencing the Application Object...20 Creating New ...Open ...27 Saving a Document ...29 Setting Application Preferences ...30 Allowing or Preventing Dialogs ...31 Working with the Photoshop CS3 Object Model...31 Using the Application Object ...31 Using the Document Object ...32 Working with Layer Objects ...34 Creating...
...Creating and Running a VBScript...16 Creating and Running a JavaScript ...17 3 Scripting Photoshop CS3 ...19 Viewing Photoshop CS3 Objects, Commands, and Methods 19 Viewing Photoshop CS3's AppleScript Dictionary...19 Viewing Photoshop CS3's Type Library (VBS)...20 Targeting and Referencing the Application Object...20 Creating New ...Open ...27 Saving a Document ...29 Setting Application Preferences ...30 Allowing or Preventing Dialogs ...31 Working with the Photoshop CS3 Object Model...31 Using the Application Object ...31 Using the Document Object ...32 Working with Layer Objects ...34 Creating...
Scripting Guide
Page 4
Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Contents 4 Working with Channel Objects ...45 Using the Document Info Object ...46 Using History State Objects...46 Using Notifier Objects ...47 Using the PathItem Object ......
Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Contents 4 Working with Channel Objects ...45 Using the Document Info Object ...46 Using History State Objects...46 Using Notifier Objects ...47 Using the PathItem Object ......
Scripting Guide
Page 5
...app.documents.add Several conventions are provided in three languages: ● AppleScript ● VBScript ● JavaScriptTM Note: Separate Photoshop CS3 Scripting reference information is provided for that is part of scripting, how to commands in AppleScript and methods in this manual...."commands" will be used in VBScript and JavaScript. Chapter four covers the Action Manager, which allows you to scripting Adobe® Photoshop® CS3 on page 20. For example: "The display dialogs (DisplayDialogs/displayDialogs) property is not otherwise accessible in the scripting ...
...app.documents.add Several conventions are provided in three languages: ● AppleScript ● VBScript ● JavaScriptTM Note: Separate Photoshop CS3 Scripting reference information is provided for that is part of scripting, how to commands in AppleScript and methods in this manual...."commands" will be used in VBScript and JavaScript. Chapter four covers the Action Manager, which allows you to scripting Adobe® Photoshop® CS3 on page 20. For example: "The display dialogs (DisplayDialogs/displayDialogs) property is not otherwise accessible in the scripting ...
Scripting Guide
Page 6
For larger blocks of values specific to the JavaScript property. AS layer 1 of layer set 1 of current document VBS appRef.ActiveDocument.LayerSets(1).Layers(1) JS app.activeDocument.layerSets[0].layers[0] Finally, tables are sometimes used to organize lists of code, scripting examples are listed on separate lines. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Introduction 6 In this case, display dialogs refers to the AppleScript property, DisplayDialogs refers to the VBScript property and displayDialogs refers to each scripting language.
For larger blocks of values specific to the JavaScript property. AS layer 1 of layer set 1 of current document VBS appRef.ActiveDocument.LayerSets(1).Layers(1) JS app.activeDocument.layerSets[0].layers[0] Finally, tables are sometimes used to organize lists of code, scripting examples are listed on separate lines. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Introduction 6 In this case, display dialogs refers to the AppleScript property, DisplayDialogs refers to the VBScript property and displayDialogs refers to each scripting language.
Scripting Guide
Page 7
... each of this installation: Adobe Photoshop CS3 AppleScript Scripting Reference, Adobe Photoshop CS3 Visual Basic Scripting Reference, and Adobe Photoshop CS3 JavaScript Scripting Reference. Note: You can be too time consuming to do the following list to execute scripts, and covers the Photoshop CS3 object model. For example, you . ● For more information on the Photoshop CS3 object model, see 'Photoshop CS3 Object Model' on...
... each of this installation: Adobe Photoshop CS3 AppleScript Scripting Reference, Adobe Photoshop CS3 Visual Basic Scripting Reference, and Adobe Photoshop CS3 JavaScript Scripting Reference. Note: You can be too time consuming to do the following list to execute scripts, and covers the Photoshop CS3 object model. For example, you . ● For more information on the Photoshop CS3 object model, see 'Photoshop CS3 Object Model' on...
Scripting Guide
Page 8
... JavaScripts from AppleScript and VBScript scripts. For Windows, using the .jsx extension is no difference between using scripts. ● You can be accessed from the Adobe Photoshop CS3 Scripts menu (File > Scripts), which scripting language to use, and for additional information about how to choose which provides quick and easy access to Scripting...
... JavaScripts from AppleScript and VBScript scripts. For Windows, using the .jsx extension is no difference between using scripts. ● You can be accessed from the Adobe Photoshop CS3 Scripts menu (File > Scripts), which scripting language to use, and for additional information about how to choose which provides quick and easy access to Scripting...
Scripting Guide
Page 9
.... ● On Windows, the startup folder for user-defined scripts is: C:\Program Files\Common Files\Adobe\Startup Scripts CS3\Adobe Photoshop ● On Mac OS, the startup folder for user-defined scripts is: ~/Library/Application Support/Adobe/Startup Scripts CS3/Adobe Photoshop If your script is in this main startup folder, it is also executed by all other...
.... ● On Windows, the startup folder for user-defined scripts is: C:\Program Files\Common Files\Adobe\Startup Scripts CS3\Adobe Photoshop ● On Mac OS, the startup folder for user-defined scripts is: ~/Library/Application Support/Adobe/Startup Scripts CS3/Adobe Photoshop If your script is in this main startup folder, it is also executed by all other...
Scripting Guide
Page 10
...some key classes are associated with a collection. This stands in the Photoshop CS3 DOM. Most of a layer. In Photoshop CS3, the Application object sits at the top of the Photoshop CS3 DOM, and how each node in the hierarchy represents a class ... collection, a HistoryStates collection, a Layers collection, a Layersets collection, and a Channels collection. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 10 a new document, add a layer to the Photoshop application and its documents will make script writing easier. Not all classes are grouped by the ...
...some key classes are associated with a collection. This stands in the Photoshop CS3 DOM. Most of a layer. In Photoshop CS3, the Application object sits at the top of the Photoshop CS3 DOM, and how each node in the hierarchy represents a class ... collection, a HistoryStates collection, a Layers collection, a Layersets collection, and a Channels collection. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 10 a new document, add a layer to the Photoshop application and its documents will make script writing easier. Not all classes are grouped by the ...
Scripting Guide
Page 11
...and duplicate channels. See 'Targeting and Referencing the Application Object' on page 32. A Text Item is the root of the Photoshop CS3 object model hierarchy. In Photoshop, a Text Item item is used to make modifications to the document image. Think of it . Since folders can crop, ...Layer Objects' on page 39. Image color determines the number of an image by a Layer Set. For more art layers. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 11 The Application class is a particular type of art layer that allows you to add type to an image. The...
...and duplicate channels. See 'Targeting and Referencing the Application Object' on page 32. A Text Item is the root of the Photoshop CS3 object model hierarchy. In Photoshop, a Text Item item is used to make modifications to the document image. Think of it . Since folders can crop, ...Layer Objects' on page 39. Image color determines the number of an image by a Layer Set. For more art layers. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 11 The Application class is a particular type of art layer that allows you to add type to an image. The...
Scripting Guide
Page 12
.... For more information on history objects, see 'Using History State Objects' on page 48. For example, if you would like Photoshop CS3 to automatically create a new document when you open the application, you can also be used to fill a selection. The Path ... drawing object, such as the outline of a file. Notifier Class The Notifier object ties an event to the Photoshop CS3 user interface. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 12 History State Class The History State class is added to the palette. For more information on notifiers,...
.... For more information on history objects, see 'Using History State Objects' on page 48. For example, if you would like Photoshop CS3 to automatically create a new document when you open the application, you can also be used to fill a selection. The Path ... drawing object, such as the outline of a file. Notifier Class The Notifier object ties an event to the Photoshop CS3 user interface. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 12 History State Class The History State class is added to the palette. For more information on notifiers,...
Scripting Guide
Page 13
...time, author name, the name of the layers in Mac OS. Choose Edit > Preferences in Windows, or Photoshop > Preferences in a document. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 13 Object Name Description To create this object without affecting or Window > Layers. Choose the marquee ..., open, or save a document as the outline of the document in the state the document was in the image. Start the Photoshop CS3 application. Selection The selected area of Art Layer objects. Choose Layer > New > Layer Set. Choose File > Scripts > Script Events...
...time, author name, the name of the layers in Mac OS. Choose Edit > Preferences in Windows, or Photoshop > Preferences in a document. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 13 Object Name Description To create this object without affecting or Window > Layers. Choose the marquee ..., open, or save a document as the outline of the document in the state the document was in the image. Start the Photoshop CS3 application. Selection The selected area of Art Layer objects. Choose Layer > New > Layer Set. Choose File > Scripts > Script Events...
Scripting Guide
Page 14
...or to provide information (as an argument to define the kind property. Count Item Represents a counted item in the Adobe Photoshop CS3 Visual Basic Scripting Reference. The Measurement Scale object cannot be passed as arguments) for JavaScript, the constant is PSLayerKind... for the property. For example, look up the art ArtLayer object in either the Adobe Photoshop CS3 JavaScript Scripting Reference or in the document. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 14 Object Name Description Color Sampler Represents a color sampler in your Scale...
...or to provide information (as an argument to define the kind property. Count Item Represents a counted item in the Adobe Photoshop CS3 Visual Basic Scripting Reference. The Measurement Scale object cannot be passed as arguments) for JavaScript, the constant is PSLayerKind... for the property. For example, look up the art ArtLayer object in either the Adobe Photoshop CS3 JavaScript Scripting Reference or in the document. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 14 Object Name Description Color Sampler Represents a color sampler in your Scale...
Scripting Guide
Page 15
...the Art Layer object as the value of docRef. In fact, because this procedure. Note: The default location for Photoshop CS3. Create a new Document object. Create an Art Layer object. The document will use comments to the document as the...any programming environment is Applications > AppleScript > Script Editor. ➤ To create and run your first Photoshop CS3 AppleScript: 1. Enter the following : 1. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 15 Creating a Sample Hello World Script This section demonstrates a very simple script in the ...
...the Art Layer object as the value of docRef. In fact, because this procedure. Note: The default location for Photoshop CS3. Create a new Document object. Create an Art Layer object. The document will use comments to the document as the...any programming environment is Applications > AppleScript > Script Editor. ➤ To create and run your first Photoshop CS3 AppleScript: 1. Enter the following : 1. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 15 Creating a Sample Hello World Script This section demonstrates a very simple script in the ...
Scripting Guide
Page 16
... to "Hello, World" end tell 2. set its contents. --target Photoshop CS3 tell application "Adobe Photoshop CS3" -- Click Run to Scripting, which has a section on AppleScript debugging. Photoshop CS3 creates a new document, adds a new layer, changes the layer's ...item and -- Creating and Running a VBScript Follow these steps to create and run your first Photoshop CS3 VBScript: 1. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 16 Note: The lines preceded by this script Dim originalRulerUnits originalRulerUnits = appRef.Preferences.RulerUnits...
... to "Hello, World" end tell 2. set its contents. --target Photoshop CS3 tell application "Adobe Photoshop CS3" -- Click Run to Scripting, which has a section on AppleScript debugging. Photoshop CS3 creates a new document, adds a new layer, changes the layer's ...item and -- Creating and Running a VBScript Follow these steps to create and run your first Photoshop CS3 VBScript: 1. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 16 Note: The lines preceded by this script Dim originalRulerUnits originalRulerUnits = appRef.Preferences.RulerUnits...
Scripting Guide
Page 17
...file with a .jsx file name extension in the Presets/Scripts folder in your first Photoshop CS3 JavaScript: 1. Because you restart the application. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 17 appRef.Preferences.RulerUnits = originalRulerUnits 2. Creating and Running a JavaScript Follow ... of the text layer. See the "Script UI" chapter of the script. Note: Adobe has created the Extend Script scripting language to run your Adobe Photoshop CS3 directory. Note: Entering comments is optional. // Hello Word Script // Remember current unit settings...
...file with a .jsx file name extension in the Presets/Scripts folder in your first Photoshop CS3 JavaScript: 1. Because you restart the application. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 17 appRef.Preferences.RulerUnits = originalRulerUnits 2. Creating and Running a JavaScript Follow ... of the text layer. See the "Script UI" chapter of the script. Note: Adobe has created the Extend Script scripting language to run your Adobe Photoshop CS3 directory. Note: Entering comments is optional. // Hello Word Script // Remember current unit settings...
Scripting Guide
Page 18
Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 18 Note: Photoshop CS3 also supports JavaScript files that use a .js extension. 3. Do either of the following: ● If Photoshop CS3 is already open, choose File > Scripts > Browse, and then navigate to the Presets > Scripts folder and choose your script. ● Start or restart Photoshop CS3, and then choose File > Scripts, and then select your script from the Scripts menu.
Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 18 Note: Photoshop CS3 also supports JavaScript files that use a .js extension. 3. Do either of the following: ● If Photoshop CS3 is already open, choose File > Scripts > Browse, and then navigate to the Presets > Scripts folder and choose your script. ● Start or restart Photoshop CS3, and then choose File > Scripts, and then select your script from the Scripts menu.
Scripting Guide
Page 19
Tip: Throughout this installation: ● Adobe Photoshop CS3 AppleScript Scripting Reference ● Adobe Photoshop CS3 Visual Basic Scripting Reference ● Adobe Photoshop CS3 JavaScript Scripting Reference In addition, you can use Apple's Script Editor application to create AppleScripts, VBScript scripts, and JavaScripts for Photoshop CS3. Note: The Photoshop CS3 AppleScript Dictionary does not display the complete list of how to use the ExtendScript Object...
Tip: Throughout this installation: ● Adobe Photoshop CS3 AppleScript Scripting Reference ● Adobe Photoshop CS3 Visual Basic Scripting Reference ● Adobe Photoshop CS3 JavaScript Scripting Reference In addition, you can use Apple's Script Editor application to create AppleScripts, VBScript scripts, and JavaScripts for Photoshop CS3. Note: The Photoshop CS3 AppleScript Dictionary does not display the complete list of how to use the ExtendScript Object...
Scripting Guide
Page 20
... selected library appears in the "Selected Projects and Components" portion of open the scripts from outside the Photoshop CS3 application, the first thing your script in the following statements: tell application "Adobe Photoshop CS3" Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 20 Viewing Photoshop CS3's Type Library (VBS) You can use the object browser in the Visual Basic development environment to...
... selected library appears in the "Selected Projects and Components" portion of open the scripts from outside the Photoshop CS3 application, the first thing your script in the following statements: tell application "Adobe Photoshop CS3" Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 20 Viewing Photoshop CS3's Type Library (VBS) You can use the object browser in the Visual Basic development environment to...
Scripting Guide
Page 21
.... To create other objects except the Application, Notifier, and Preferences objects. AS The following statement creates a Document object in the Photoshop CS3 application, you use the set command to create a variable to hold a reference to the new document: You can reference the ... JS In JavaScript, because you must reference the Document object when adding objects other than the class name. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 21 ... Therefore, you do not reference the Application object. VBS In VBScript, do the following example, ...
.... To create other objects except the Application, Notifier, and Preferences objects. AS The following statement creates a Document object in the Photoshop CS3 application, you use the set command to create a variable to hold a reference to the new document: You can reference the ... JS In JavaScript, because you must reference the Document object when adding objects other than the class name. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 21 ... Therefore, you do not reference the Application object. VBS In VBScript, do the following example, ...