Scripting Guide
Page 2
... with the terms of their respective owners. Adobe Systems Incorporated assumes no responsibility or liability for any errors or inaccuracies, makes no part of Adobe Systems Incorporated. Adobe®, the Adobe logo, Illustrator®, and Photoshop® are the property of such license....registered trademarks or trademarks of Apple Computer, Inc., registered in the United States and/or other countries. Adobe® Creative Suite® 3 Photoshop® Scripting Guide for particular purposes, and noninfringement of their respective owners. in this guide may appear...
... with the terms of their respective owners. Adobe Systems Incorporated assumes no responsibility or liability for any errors or inaccuracies, makes no part of Adobe Systems Incorporated. Adobe®, the Adobe logo, Illustrator®, and Photoshop® are the property of such license....registered trademarks or trademarks of Apple Computer, Inc., registered in the United States and/or other countries. Adobe® Creative Suite® 3 Photoshop® Scripting Guide for particular purposes, and noninfringement of their respective owners. in this guide may appear...
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
...and information about using the Extend Script Object Model Viewer, see the JavaScript Tools Guide. See 'Viewing Photoshop CS3's AppleScript Dictionary' on page 19 and 'Viewing Photoshop CS3's Type Library (VBS)' on Mac OS® and Windows®. 1 Introduction About this manual ...This manual provides an introduction to scripting Adobe® Photoshop® CS3 on page 20. Conventions in this manual follows the AppleScript naming convention for scripting the Photoshop CS3 application. When referring to specific properties and commands, this guide Code...
...and information about using the Extend Script Object Model Viewer, see the JavaScript Tools Guide. See 'Viewing Photoshop CS3's AppleScript Dictionary' on page 19 and 'Viewing Photoshop CS3's Type Library (VBS)' on Mac OS® and Windows®. 1 Introduction About this manual ...This manual provides an introduction to scripting Adobe® Photoshop® CS3 on page 20. Conventions in this manual follows the AppleScript naming convention for scripting the Photoshop CS3 application. When referring to specific properties and commands, this guide Code...
Scripting Guide
Page 6
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. AS layer 1 of layer set 1 of values specific to the JavaScript property.
Scripting Guide
Page 7
... in an image: "If the selected area is most likely will want to Scripting guide. ● For examples of this installation: Adobe Photoshop CS3 AppleScript Scripting Reference, Adobe Photoshop CS3 Visual Basic Scripting Reference, and Adobe Photoshop CS3 JavaScript Scripting Reference. Scripting allows you to you 're already familiar with actions: ● You can add conditional logic, so that...
... in an image: "If the selected area is most likely will want to Scripting guide. ● For examples of this installation: Adobe Photoshop CS3 AppleScript Scripting Reference, Adobe Photoshop CS3 Visual Basic Scripting Reference, and Adobe Photoshop CS3 JavaScript Scripting Reference. Scripting allows you to you 're already familiar with actions: ● You can add conditional logic, so that...
Scripting Guide
Page 8
... a valid script file it cannot launch Photoshop CS3. If you were using the .js and .jsx extension. Note: See Photoshop CS3 Help for more versatility for file paths. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 8 ● A single script can be accessed from AppleScript and VBScript scripts. Scripting Support in Photoshop CS3 Photoshop CS3 supports scripting in JavaScript can perform actions that...
... a valid script file it cannot launch Photoshop CS3. If you were using the .js and .jsx extension. Note: See Photoshop CS3 Help for more versatility for file paths. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 8 ● A single script can be accessed from AppleScript and VBScript scripts. Scripting Support in Photoshop CS3 Photoshop CS3 supports scripting in JavaScript can perform actions that...
Scripting Guide
Page 9
...finds in the startup folders. ● 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 that application) through a scripting language. You can execute either a single... installed in the Scripts menu until the next time you to programmatically access and manipulate the document and its components. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 9 To install a JavaScript in the Scripts menu, place it in the browse dialog. If such a...
...finds in the startup folders. ● 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 that application) through a scripting language. You can execute either a single... installed in the Scripts menu until the next time you to programmatically access and manipulate the document and its components. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 9 To install a JavaScript in the Scripts menu, place it in the browse dialog. If such a...
Scripting Guide
Page 10
... will make script writing easier. Containment Hierarchy The Photoshop CS3 object model is available through the Photoshop CS3 user interface is a containment hierarchy, which index from 1 rather than 0. Not all classes are identified partially by elements or collection. Caution: In Photoshop, VBScript collections index from 0. . Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 10 a new document, add a layer to...
... will make script writing easier. Containment Hierarchy The Photoshop CS3 object model is available through the Photoshop CS3 user interface is a containment hierarchy, which index from 1 rather than 0. Not all classes are identified partially by elements or collection. Caution: In Photoshop, VBScript collections index from 0. . Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 10 a new document, add a layer to...
Scripting Guide
Page 11
... the Document object you to specify an area of a layout within the active document or between different documents. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 11 The Application class is implemented as a folder on page 20. Scripts must target the appropriate application... in a selected layer of the Photoshop CS3 object model hierarchy. See 'Targeting and Referencing the Application Object' on your desktop. You could choose to store pixel information about an image's color. In Photoshop, a Text Item item is the root of...
... the Document object you to specify an area of a layout within the active document or between different documents. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 11 The Application class is implemented as a folder on page 20. Scripts must target the appropriate application... in a selected layer of the Photoshop CS3 object model hierarchy. See 'Targeting and Referencing the Application Object' on your desktop. You could choose to store pixel information about an image's color. In Photoshop, a Text Item item is the root of...
Scripting Guide
Page 12
... Document Info Class The Document Info class stores metadata about a drawing object, such as the outline of the shape. 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 changes made to ...application-before you create a document and then immediately try to set the user preference settings. For example, if you would like Photoshop CS3 to automatically create a new document when you open the application, you could tie a script that allows you to an Open ...
... Document Info Class The Document Info class stores metadata about a drawing object, such as the outline of the shape. 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 changes made to ...application-before you create a document and then immediately try to set the user preference settings. For example, if you would like Photoshop CS3 to automatically create a new document when you open the application, you could tie a script that allows you to an Open ...
Scripting Guide
Page 13
... create layers, channels, actions, and so on one element of an image without using a script: Application The Photoshop CS3 application. For example, when a user clicks an OK button, the notifier object tells the script what to execute... preference settings. Channel Pixel information about a Document object. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 13 Object Name Description To create this object without affecting or Window > Layers. Start the Photoshop CS3 application. In Photoshop CS3, choose File > New or File > Open. Choose ...
... create layers, channels, actions, and so on one element of an image without using a script: Application The Photoshop CS3 application. For example, when a user clicks an OK button, the notifier object tells the script what to execute... preference settings. Channel Pixel information about a Document object. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 13 Object Name Description To create this object without affecting or Window > Layers. Start the Photoshop CS3 application. In Photoshop CS3, choose File > New or File > Open. Choose ...
Scripting Guide
Page 14
..., you can define only specific kinds that defines a property. Count Item Represents a counted item in the Adobe Photoshop CS3 Visual Basic Scripting Reference. Constants An additional important component of the ' from being read by using a script...indicates psLayerKind --> 2 (psTextLayer) The ' before the explanation creates a comment and prevents the text to Scripting. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 14 Object Name Description Color Sampler Represents a color sampler in your Scale document. For general information ...
..., you can define only specific kinds that defines a property. Count Item Represents a counted item in the Adobe Photoshop CS3 Visual Basic Scripting Reference. Constants An additional important component of the ' from being read by using a script...indicates psLayerKind --> 2 (psTextLayer) The ' before the explanation creates a comment and prevents the text to Scripting. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 14 Object Name Description Color Sampler Represents a color sampler in your Scale document. For general information ...
Scripting Guide
Page 15
...and then assign a reference to complete this is our first script, we will also include comments throughout the scripts. 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 each of the ...three scripting languages for the Script Editor is Applications > AppleScript > Script Editor. ➤ To create and run your first Photoshop CS3 AppleScript: 1. Create a new Document object. In our script, we will do the following script in the containment hierarchy, as a...
...and then assign a reference to complete this is our first script, we will also include comments throughout the scripts. 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 each of the ...three scripting languages for the Script Editor is Applications > AppleScript > Script Editor. ➤ To create and run your first Photoshop CS3 AppleScript: 1. Create a new Document object. In our script, we will do the following script in the containment hierarchy, as a...
Scripting Guide
Page 16
...:2 as inches} set artLayerRef to make new art layer in a Photoshop CS3 document. ➤ To create and run your first Photoshop CS3 VBScript: 1. set its contents. --target Photoshop CS3 tell application "Adobe Photoshop CS3" -- Creating and Running a VBScript Follow these steps to Scripting, ... are comments. Dim appRef Set appRef = CreateObject( "Photoshop.Application" ) ' Remember current unit settings and then set contents of text object of the text layer. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 16 Note: The lines preceded by this script...
...:2 as inches} set artLayerRef to make new art layer in a Photoshop CS3 document. ➤ To create and run your first Photoshop CS3 VBScript: 1. set its contents. --target Photoshop CS3 tell application "Adobe Photoshop CS3" -- Creating and Running a VBScript Follow these steps to Scripting, ... are comments. Dim appRef Set appRef = CreateObject( "Photoshop.Application" ) ' Remember current unit settings and then set contents of text object of the text layer. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 16 Note: The lines preceded by this script...
Scripting Guide
Page 17
... run a JavaScript that manipulate Photoshop CS3 from the File > Scripts menu in Windows Explorer to run your JavaScripts, it to include code that opens Photoshop CS3 at the beginning of the script. Note: You must place your Adobe Photoshop CS3 directory. See the "Script UI" chapter of the text layer. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 17 appRef.Preferences...
... run a JavaScript that manipulate Photoshop CS3 from the File > Scripts menu in Windows Explorer to run your JavaScripts, it to include code that opens Photoshop CS3 at the beginning of the script. Note: You must place your Adobe Photoshop CS3 directory. See the "Script UI" chapter of the text layer. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 17 appRef.Preferences...
Scripting Guide
Page 18
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. 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.
Scripting Guide
Page 19
... each 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 quickly understand how to script Photoshop CS3. See the JavaScript Tools Guide for each command. Script Editor opens Photoshop CS3 and then displays the Photoshop CS3 dictionary, which lists objects as well as the...
... each 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 quickly understand how to script Photoshop CS3. See the JavaScript Tools Guide for each command. Script Editor opens Photoshop CS3 and then displays the Photoshop CS3 dictionary, which lists objects as well as the...
Scripting Guide
Page 20
... select Edit Custom Component Set. 4. Choose Photoshop CS3 type library from outside the Photoshop CS3 application, the first thing your script in the following statements: tell application "Adobe Photoshop CS3" On the COM tab, find "Adobe Photoshop CS3 Object Library". The selected library appears in ... In the Browse drop-down menu. 5. Click on the plus sign next to the Photoshop objects icon. 9. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 20 Viewing Photoshop CS3's Type Library (VBS) You can also use the VBA editor in Microsoft Word to ...
... select Edit Custom Component Set. 4. Choose Photoshop CS3 type library from outside the Photoshop CS3 application, the first thing your script in the following statements: tell application "Adobe Photoshop CS3" On the COM tab, find "Adobe Photoshop CS3 Object Library". The selected library appears in ... In the Browse drop-down menu. 5. Click on the plus sign next to the Photoshop objects icon. 9. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 20 Viewing Photoshop CS3's Type Library (VBS) You can also use the VBA editor in Microsoft Word to ...
Scripting Guide
Page 21
Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 21 ... You can reference the application as part of objects ... layer to name the object type. you add a document to accomplish these same tasks in the 'Photoshop CS3 Object Model' on elements and collections. Therefore, you can also use the set command to create a...Application object throughout the script. In the following to target the application: Dim appRef Set appRef = CreateObject("Photoshop.Application") JS In JavaScript, because you select File > New. Creating New Objects in a Script To create...
Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 21 ... You can reference the application as part of objects ... layer to name the object type. you add a document to accomplish these same tasks in the 'Photoshop CS3 Object Model' on elements and collections. Therefore, you can also use the set command to create a...Application object throughout the script. In the following to target the application: Dim appRef Set appRef = CreateObject("Photoshop.Application") JS In JavaScript, because you select File > New. Creating New Objects in a Script To create...