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
... be used when referring to specific properties and commands, this installation, or through the Scripting Reference Manuals provided with Photoshop CS3 for scripting the Photoshop CS3 application. Chapter four covers the Action Manager, which allows you to commands in AppleScript and methods in the scripting ...an introduction to scripting Adobe® Photoshop® CS3 on page 20. Note: Please review the README file shipped with this manual follows the AppleScript naming convention for that is part of scripting, how to execute scripts, and the Photoshop CS3 object model. Code ...
... be used when referring to specific properties and commands, this installation, or through the Scripting Reference Manuals provided with Photoshop CS3 for scripting the Photoshop CS3 application. Chapter four covers the Action Manager, which allows you to commands in AppleScript and methods in the scripting ...an introduction to scripting Adobe® Photoshop® CS3 on page 20. Note: Please review the README file shipped with this manual follows the AppleScript naming convention for that is part of scripting, how to execute scripts, and the Photoshop CS3 object model. 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. 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. For larger blocks 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. 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. For larger blocks of values specific to the JavaScript property.
Scripting Guide
Page 7
... as applying different filters to Scripting manual. otherwise add a red border." 7 2 Photoshop CS3 Scripting Basics This chapter provides an overview of actions? Scripting allows you 're already ...Photoshop CS3 script. See 'Viewing Photoshop CS3 Objects, Commands, and Methods' on selecting a scripting language, refer to the Introduction to Scripting guide. ● For examples of how to generate a number of localized versions of this installation: Adobe Photoshop CS3 AppleScript Scripting Reference, Adobe Photoshop CS3 Visual Basic Scripting Reference, and Adobe Photoshop CS3...
... as applying different filters to Scripting manual. otherwise add a red border." 7 2 Photoshop CS3 Scripting Basics This chapter provides an overview of actions? Scripting allows you 're already ...Photoshop CS3 script. See 'Viewing Photoshop CS3 Objects, Commands, and Methods' on selecting a scripting language, refer to the Introduction to Scripting guide. ● For examples of how to generate a number of localized versions of this installation: Adobe Photoshop CS3 AppleScript Scripting Reference, Adobe Photoshop CS3 Visual Basic Scripting Reference, and Adobe Photoshop CS3...
Scripting Guide
Page 8
...open, save, and rename files using the .js and .jsx extension. Scripts written in JavaScript can call JavaScript scripts from the Adobe Photoshop CS3 Scripts menu (File > Scripts), which scripting language to be recognized by double-clicking on it, a script with the .js... use either a .js or a .jsx extension. You can be accessed directly from AS or VBS' on page 9. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 8 ● A single script can use variables for more versatility for additional information about how to choose which ...
...open, save, and rename files using the .js and .jsx extension. Scripts written in JavaScript can call JavaScript scripts from the Adobe Photoshop CS3 Scripts menu (File > Scripts), which scripting language to be recognized by double-clicking on it, a script with the .js... use either a .js or a .jsx extension. You can be accessed directly from AS or VBS' on page 9. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 8 ● A single script can use variables for more versatility for additional information about how to choose which ...
Scripting Guide
Page 9
... 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 running scripts from AS or VBS... in the Scripts folder after the application was last launched. Photoshop CS3 Object Model A document object model (DOM) is executed the same way as defined for execution. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 9 To install a JavaScript in the Scripts menu...
... 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 running scripts from AS or VBS... in the Scripts folder after the application was last launched. Photoshop CS3 Object Model A document object model (DOM) is executed the same way as defined for execution. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 9 To install a JavaScript in the Scripts menu...
Scripting Guide
Page 10
... a collection. This stands in contrast to other VBScript arrays, which means that objects in the Photoshop CS3 DOM. A good understanding of the functionality available through the Photoshop CS3 user interface is a containment hierarchy, which index from 1 rather than 0. Applications contain a Documents... State Sub Path Item Path Point Text Item (Object) Art Layer Layer Set Application and Document Classes 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...
... a collection. This stands in contrast to other VBScript arrays, which means that objects in the Photoshop CS3 DOM. A good understanding of the functionality available through the Photoshop CS3 user interface is a containment hierarchy, which index from 1 rather than 0. Applications contain a Documents... State Sub Path Item Path Point Text Item (Object) Art Layer Layer Set Application and Document Classes 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...
Scripting Guide
Page 11
.... You can contain other folders, a layer set in the Object Model hierarchy. In Photoshop, a Text Item item is recursive. A Layer Set is the root of the Photoshop CS3 object model hierarchy. Since folders can change the current channel selection. You could have the...editing the entire image. You can also retrieve a channel's histogram, change its kind or change the composition of it . Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 11 The Application class is a class that comprises multiple layers. For more art layers. Layer Comp Class The...
.... You can contain other folders, a layer set in the Object Model hierarchy. In Photoshop, a Text Item item is recursive. A Layer Set is the root of the Photoshop CS3 object model hierarchy. Since folders can change the current channel selection. You could have the...editing the entire image. You can also retrieve a channel's histogram, change its kind or change the composition of it . Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 11 The Application class is a class that comprises multiple layers. For more art layers. Layer Comp Class The...
Scripting Guide
Page 12
...on page 48. For more information on notifiers, see 'Using Notifier Objects' on page 46. Each time you to the Photoshop CS3 user interface. Count Item Class The Count Item object provides scripting support for the Color Sampler Tool. Measurement Scale Class The ... document. Note: In AppleScript, if you could tie a script that creates a Document object to get history state, Photoshop returns an error. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 12 History State Class The History State class is any data that helps to access and set a scale...
...on page 48. For more information on notifiers, see 'Using Notifier Objects' on page 46. Each time you to the Photoshop CS3 user interface. Count Item Class The Count Item object provides scripting support for the Color Sampler Tool. Measurement Scale Class The ... document. Note: In AppleScript, if you could tie a script that creates a Document object to get history state, Photoshop returns an error. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 12 History State Class The History State class is any data that helps to access and set a scale...
Scripting Guide
Page 13
...in which you create layers, channels, actions, and so on one element of an image without using a script: Application The Photoshop CS3 application. Channel Pixel information about a Document object. Choose Window > Channels. Art Layer A layer class within a document that ...and then choose a history state from the History palette. In a script, you would a file in the file, etc. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 13 Object Name Description To create this object without affecting or Window > Layers. Then select the New Layer Comp ...
...in which you create layers, channels, actions, and so on one element of an image without using a script: Application The Photoshop CS3 application. Channel Pixel information about a Document object. Choose Window > Channels. Art Layer A layer class within a document that ...and then choose a history state from the History palette. In a script, you would a file in the file, etc. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 13 Object Name Description To create this object without affecting or Window > Layers. Then select the New Layer Comp ...
Scripting Guide
Page 14
..., actual values of this object without using Image > Measurement Scale > Custom. Click the link to Scripting. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 14 Object Name Description Color Sampler Represents a color sampler in the document. Choose the Count Tool and...Open and save (saveAs/saveAs) command or method. For example, look up the art ArtLayer object in either the Adobe Photoshop CS3 JavaScript Scripting Reference or in the document. One of the properties of enumerations for VBScript are different than the constant ...
..., actual values of this object without using Image > Measurement Scale > Custom. Click the link to Scripting. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 14 Object Name Description Color Sampler Represents a color sampler in the document. Choose the Count Tool and...Open and save (saveAs/saveAs) command or method. For example, look up the art ArtLayer object in either the Adobe Photoshop CS3 JavaScript Scripting Reference or in the document. One of the properties of enumerations for VBScript are different than the constant ...
Scripting Guide
Page 15
...comments to complete this is Applications > AppleScript > Script Editor. ➤ To create and run your first Photoshop CS3 AppleScript: 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 each of the...to excess. Create an Art Layer object. The document will also include comments throughout the scripts. Open the Photoshop CS3 application. 2. Application Document Art Layer Text Item Creating and Running an AppleScript You must open Apple's Script ...
...comments to complete this is Applications > AppleScript > Script Editor. ➤ To create and run your first Photoshop CS3 AppleScript: 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 each of the...to excess. Create an Art Layer object. The document will also include comments throughout the scripts. Open the Photoshop CS3 application. 2. Application Document Art Layer Text Item Creating and Running an AppleScript You must open Apple's Script ...
Scripting Guide
Page 16
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.Preferences.RulerUnits = 2 ' Create ...as inches} set contents of text object of the text layer. set its contents. --target Photoshop CS3 tell application "Adobe Photoshop CS3" -- Get a reference to ' the value expected by "--" are comments. Dim appRef Set appRef = CreateObject( "Photoshop.Application" ) ' Remember current unit settings and then set units to the text object and ...
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.Preferences.RulerUnits = 2 ' Create ...as inches} set contents of text object of the text layer. set its contents. --target Photoshop CS3 tell application "Adobe Photoshop CS3" -- Get a reference to ' the value expected by "--" are comments. Dim appRef Set appRef = CreateObject( "Photoshop.Application" ) ' Remember current unit settings and then set units to the text object and ...
Scripting Guide
Page 17
... open JavaScripts that manipulate Photoshop CS3 from the File > Scripts menu in your Adobe Photoshop CS3 directory. Type the following script. Double-click the file in a Photoshop CS3 document. The script opens Photoshop CS3. Save file as a text file with a .jsx file name extension in the Presets/Scripts folder in your file system. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 17 appRef...
... open JavaScripts that manipulate Photoshop CS3 from the File > Scripts menu in your Adobe Photoshop CS3 directory. Type the following script. Double-click the file in a Photoshop CS3 document. The script opens Photoshop CS3. Save file as a text file with a .jsx file name extension in the Presets/Scripts folder in your file system. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 17 appRef...
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
... information. The dictionary also lists the parameters for 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 can use to view the Photoshop CS3 AppleScript Dictionary. ● For VBScript, use the VBA editor in Microsoft Word, or the Visual...
... information. The dictionary also lists the parameters for 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 can use to view the Photoshop CS3 AppleScript Dictionary. ● For VBScript, use the VBA editor in Microsoft Word, or the Visual...
Scripting Guide
Page 20
... loaded into the object browser. In the Browse drop-down menu. 5. Now the Photoshop CS3 Library is indicate that the commands be executed in Photoshop CS3. Start Word, and then choose Tools > Macro > Visual Basic Editor. 2. 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...
... loaded into the object browser. In the Browse drop-down menu. 5. Now the Photoshop CS3 Library is indicate that the commands be executed in Photoshop CS3. Start Word, and then choose Tools > Macro > Visual Basic Editor. 2. 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...
Scripting Guide
Page 21
...The following example, the variable named docRef holds a reference to the Documents collection; Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 21 ... You can see in an AppleScript. In the following statement creates a Document object in the 'Photoshop CS3 Object Model' on page 9, the Document object contains all properties and methods of... (It is no need to name the object type. Creating New Objects in a Script To create a new document in the Photoshop CS3 application, you add a document to the new document: For example, you select File > New.
...The following example, the variable named docRef holds a reference to the Documents collection; Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 21 ... You can see in an AppleScript. In the following statement creates a Document object in the 'Photoshop CS3 Object Model' on page 9, the Document object contains all properties and methods of... (It is no need to name the object type. Creating New Objects in a Script To create a new document in the Photoshop CS3 application, you add a document to the new document: For example, you select File > New.
Scripting Guide
Page 22
... up the object in the variable named docRef. The following sample creates an art layer in the document contained in the Adobe Photoshop CS3 AppleScript Scripting Reference. That is available for the object. Similarly, the ArtLayer object does not have an Add() method; ...of the object description. The Add method is a collection object, it is not valid with the collection name. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 22 set docRef to make new document To create an object other than collection objects. See 'Targeting and Referencing the...
... up the object in the variable named docRef. The following sample creates an art layer in the document contained in the Adobe Photoshop CS3 AppleScript Scripting Reference. That is available for the object. Similarly, the ArtLayer object does not have an Add() method; ...of the object description. The Add method is a collection object, it is not valid with the collection name. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 22 set docRef to make new document To create an object other than collection objects. See 'Targeting and Referencing the...