Scripting Guide
Page 2
...subject to any kind (express, implied, or statutory) with the terms of Adobe Systems Incorporated. Please note that includes an end user license agreement. Adobe® Creative Suite® 3 Photoshop® Scripting Guide for particular purposes, and noninfringement of this guide may be...the information herein is furnished AS IS, is a registered trademark of Adobe Systems Incorporated. Adobe®, the Adobe logo, Illustrator®, and Photoshop® are either registered trademarks or trademarks of Adobe Systems Incorporated in any form or by any such license, no ...
...subject to any kind (express, implied, or statutory) with the terms of Adobe Systems Incorporated. Please note that includes an end user license agreement. Adobe® Creative Suite® 3 Photoshop® Scripting Guide for particular purposes, and noninfringement of this guide may be...the information herein is furnished AS IS, is a registered trademark of Adobe Systems Incorporated. Adobe®, the Adobe logo, Illustrator®, and Photoshop® are either registered trademarks or trademarks of Adobe Systems Incorporated in any form or by any such license, no ...
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
...scripting, how to execute scripts, and the Photoshop CS3 object model. See 'Viewing Photoshop CS3's AppleScript Dictionary' on page 19 and 'Viewing Photoshop CS3's Type Library (VBS)' on Mac OS®...Adobe® Photoshop® CS3 on page 20. Chapter four covers the Action Manager, which allows you to specific properties and commands, this manual. Note: Please review the README file shipped with this installation, or through the Scripting Reference Manuals provided with Photoshop CS3 for scripting the Photoshop CS3 application. When referring to write scripts that target Photoshop CS3...
...scripting, how to execute scripts, and the Photoshop CS3 object model. See 'Viewing Photoshop CS3's AppleScript Dictionary' on page 19 and 'Viewing Photoshop CS3's Type Library (VBS)' on Mac OS®...Adobe® Photoshop® CS3 on page 20. Chapter four covers the Action Manager, which allows you to specific properties and commands, this manual. Note: Please review the README file shipped with this installation, or through the Scripting Reference Manuals provided with Photoshop CS3 for scripting the Photoshop CS3 application. When referring to write scripts that target Photoshop CS3...
Scripting Guide
Page 6
AS layer 1 of layer set 1 of values specific to the JavaScript property. 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 code, scripting examples are sometimes used to organize lists of current document VBS appRef.ActiveDocument.LayerSets(1).Layers(1) JS app.activeDocument.layerSets[0].layers[0] Finally, tables are listed on separate lines.
AS layer 1 of layer set 1 of values specific to the JavaScript property. 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 code, scripting examples are sometimes used to organize lists of current document VBS appRef.ActiveDocument.LayerSets(1).Layers(1) JS app.activeDocument.layerSets[0].layers[0] Finally, tables are listed on separate lines.
Scripting Guide
Page 7
... of a particular image or to add depending on selecting a scripting language, refer to the Introduction to skip much of this installation: Adobe Photoshop CS3 AppleScript Scripting Reference, Adobe Photoshop CS3 Visual Basic Scripting Reference, and Adobe Photoshop CS3 JavaScript Scripting Reference. For example, you could write a script that the script automatically makes "decisions" based on page 19. It provides...
... of a particular image or to add depending on selecting a scripting language, refer to the Introduction to skip much of this installation: Adobe Photoshop CS3 AppleScript Scripting Reference, Adobe Photoshop CS3 Visual Basic Scripting Reference, and Adobe Photoshop CS3 JavaScript Scripting Reference. For example, you could write a script that the script automatically makes "decisions" based on page 19. It provides...
Scripting Guide
Page 8
... .jsx extension. On the Mac OS, there is interpreted with the two extensions function. You can be accessed directly from AS or VBS' on Photoshop CS3 Actions. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 8 ● A single script can copy scripts from AppleScript and VBScript scripts. For information about using scripts. ● You can perform actions...
... .jsx extension. On the Mac OS, there is interpreted with the two extensions function. You can be accessed directly from AS or VBS' on Photoshop CS3 Actions. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 8 ● A single script can copy scripts from AppleScript and VBScript scripts. For information about using scripts. ● You can perform actions...
Scripting Guide
Page 9
... refer to Introduction to select scripts installed in the Scripts folder after the application was last launched. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 9 To install a JavaScript in the Scripts menu, place it , and the components of the documents...scripts that are not installed in the Scripts folder (Photoshop CS3 /Presets /Scripts). Any number of sub-folders does not add a hierarchical organization to select a script file for execution. Executing other Adobe Creative Suite 3 applications at startup. Executing JavaScripts from ...
... refer to Introduction to select scripts installed in the Scripts folder after the application was last launched. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 9 To install a JavaScript in the Scripts menu, place it , and the components of the documents...scripts that are not installed in the Scripts folder (Photoshop CS3 /Presets /Scripts). Any number of sub-folders does not add a hierarchical organization to select a script file for execution. Executing other Adobe Creative Suite 3 applications at startup. Executing JavaScripts from ...
Scripting Guide
Page 10
..., Layers, Layer Comps, Layer Sets, History States, Notifiers, Path Items, Path Points Sub Path Items, and Text Fonts. In Photoshop CS3, the Application object sits at the top of a layer. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 10 a new document, add a layer to an existing document, or change individual object properties like color, size and...
..., Layers, Layer Comps, Layer Sets, History States, Notifiers, Path Items, Path Points Sub Path Items, and Text Fonts. In Photoshop CS3, the Application object sits at the top of a layer. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 10 a new document, add a layer to an existing document, or change individual object properties like color, size and...
Scripting Guide
Page 11
...other folders, a layer set in the image, or you to the document mode and are related to create additional channels. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 11 The Application class is recursive. Scripts must target the appropriate application in a Script' on page 21 and ... zero or more information on selections, see 'Using the Text Item Object' on page 20. That is a particular type of the Photoshop CS3 object model hierarchy. Image color determines the number of it . You could choose to an image. These kinds of an image by...
...other folders, a layer set in the image, or you to the document mode and are related to create additional channels. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 11 The Application class is recursive. Scripts must target the appropriate application in a Script' on page 21 and ... zero or more information on selections, see 'Using the Text Item Object' on page 20. That is a particular type of the Photoshop CS3 object model hierarchy. Image color determines the number of it . You could choose to an image. These kinds of an image by...
Scripting Guide
Page 12
...Preferences Class The Preferences class allows you could tie a script that creates a Document object to the Photoshop CS3 user interface. For example, if you would like Photoshop CS3 to automatically create a new document when you open the application, you to set the user preference...is contained in a sub path. Color Sampler Class The Color Sampler object provides scripting support for the Count Tool. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 12 History State Class The History State class is a palette object that keeps track of a file. Metadata...
...Preferences Class The Preferences class allows you could tie a script that creates a Document object to the Photoshop CS3 user interface. For example, if you would like Photoshop CS3 to automatically create a new document when you open the application, you to set the user preference...is contained in a sub path. Color Sampler Class The Color Sampler object provides scripting support for the Count Tool. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 12 History State Class The History State class is a palette object that keeps track of a file. Metadata...
Scripting Guide
Page 13
... you create layers, channels, actions, and so on one element of an image without using a script: Application The Photoshop CS3 application. Preferences The application preference settings. Choose Layer > New > Layer Set. Document Info Metadata about an image's ...Notifier Notifies a script when an event occurs; the event then triggers the script to a previous state. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 13 Object Name Description To create this object without affecting or Window > Layers. Note: Metadata...
... you create layers, channels, actions, and so on one element of an image without using a script: Application The Photoshop CS3 application. Preferences The application preference settings. Choose Layer > New > Layer Set. Document Info Metadata about an image's ...Notifier Notifies a script when an event occurs; the event then triggers the script to a previous state. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 13 Object Name Description To create this object without affecting or Window > Layers. Note: Metadata...
Scripting Guide
Page 14
...( kind). For example, look up the art ArtLayer object in either the Adobe Photoshop CS3 JavaScript Scripting Reference or in the document. Additional Objects The Photoshop CS3 object model includes additional objects beyond the ones described in your Scale document..../foregroundColor) properties of an Art Layer object, you can define only specific kinds that defines a property. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 14 Object Name Description Color Sampler Represents a color sampler in the containment hierarchy above. Count ...
...( kind). For example, look up the art ArtLayer object in either the Adobe Photoshop CS3 JavaScript Scripting Reference or in the document. Additional Objects The Photoshop CS3 object model includes additional objects beyond the ones described in your Scale document..../foregroundColor) properties of an Art Layer object, you can define only specific kinds that defines a property. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 14 Object Name Description Color Sampler Represents a color sampler in the containment hierarchy above. Count ...
Scripting Guide
Page 15
... the contents of artLayerRef. 4. In fact, because this procedure. Note: The default location for Photoshop CS3. Create a new Document object. Note: We will be 4 inches wide and 2 inches high. 3. Enter the following : 1. Open the Photoshop CS3 application. 2. 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 contents of artLayerRef. 4. In fact, because this procedure. Note: The default location for Photoshop CS3. Create a new Document object. Note: We will be 4 inches wide and 2 inches high. 3. Enter the following : 1. Open the Photoshop CS3 application. 2. 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...
Scripting Guide
Page 16
...width:4 as inches, height:2 as inches} set kind of artLayerRef to text layer -- set its contents. --target Photoshop CS3 tell application "Adobe Photoshop CS3" -- in docRef -- Type the following script into a script or text editor. Dim docRef Dim artLayerRef Dim textItemRef...a VBScript Follow these steps to create a new text item and -- Entering the comments is optional. 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 appRef....
...width:4 as inches, height:2 as inches} set kind of artLayerRef to text layer -- set its contents. --target Photoshop CS3 tell application "Adobe Photoshop CS3" -- in docRef -- Type the following script into a script or text editor. Dim docRef Dim artLayerRef Dim textItemRef...a VBScript Follow these steps to create a new text item and -- Entering the comments is optional. 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 appRef....
Scripting Guide
Page 17
... as a text file with a .jsx file name extension in the Presets/Scripts folder in Windows Explorer to make the scripts accessible from anywhere in a Photoshop CS3 document. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 17 appRef.Preferences.RulerUnits = originalRulerUnits 2. The scripts do not appear on the File > Scripts menu until you will be actually using...
... as a text file with a .jsx file name extension in the Presets/Scripts folder in Windows Explorer to make the scripts accessible from anywhere in a Photoshop CS3 document. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 17 appRef.Preferences.RulerUnits = originalRulerUnits 2. The scripts do not appear on the File > Scripts menu until you will be actually using...
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
... about the specific elements used in the script. Viewing Photoshop CS3's AppleScript Dictionary You use to create AppleScripts, VBScript scripts, and JavaScripts for Photoshop CS3. Choose AdobePhotoshop CS3, and then click Open. 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 also access...
... about the specific elements used in the script. Viewing Photoshop CS3's AppleScript Dictionary You use to create AppleScripts, VBScript scripts, and JavaScripts for Photoshop CS3. Choose AdobePhotoshop CS3, and then click Open. 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 also access...
Scripting Guide
Page 20
... is loaded into the object browser. 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 the Photoshop Library icon. 8. Select it. 5. Now the Photoshop CS3 Library is indicate that the commands be executed in the Photoshop CS3 library are listed. Start Visual Studio...
... is loaded into the object browser. 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 the Photoshop Library icon. 8. Select it. 5. Now the Photoshop CS3 Library is indicate that the commands be executed in the Photoshop CS3 library are listed. Start Visual Studio...
Scripting Guide
Page 21
...create other objects except the Application, Notifier, and Preferences objects. In the following statements are accessible without any qualification. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 21 ... VBS In VBScript, do not need to a new document. Therefore, you want to create and then ... object's collection name to the new document: Creating New Objects in a Script To create a new document in the 'Photoshop CS3 Object Model' on the appropriate palette. end tell Note: Because you to the Documents collection; This section demonstrates how to...
...create other objects except the Application, Notifier, and Preferences objects. In the following statements are accessible without any qualification. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 21 ... VBS In VBScript, do not need to a new document. Therefore, you want to create and then ... object's collection name to the new document: Creating New Objects in a Script To create a new document in the 'Photoshop CS3 Object Model' on the appropriate palette. end tell Note: Because you to the Documents collection; This section demonstrates how to...