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
...font: app.documents.add Several conventions are provided in three languages: ● AppleScript ● VBScript ● JavaScriptTM Note: Separate Photoshop CS3 Scripting reference information is part of these languages through the object browsers available for each of the Application object." 5 Code examples are... used to refer both to scripting Adobe® Photoshop® CS3 on page 20. Note: Please review the README file shipped with this installation, or through the Scripting Reference Manuals ...
...font: app.documents.add Several conventions are provided in three languages: ● AppleScript ● VBScript ● JavaScriptTM Note: Separate Photoshop CS3 Scripting reference information is part of these languages through the object browsers available for each of the Application object." 5 Code examples are... used to refer both to scripting Adobe® Photoshop® CS3 on page 20. Note: Please review the README file shipped with this installation, or through the Scripting Reference Manuals ...
Scripting Guide
Page 6
AS layer 1 of layer set 1 of values specific to the JavaScript property. 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. 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 values specific to the JavaScript property. 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. 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
... you could write a script that is not available for use with the enormous benefits of scripting for Photoshop, describes scripting support for each of this installation: Adobe Photoshop CS3 AppleScript Scripting Reference, Adobe Photoshop CS3 Visual Basic Scripting Reference, and Adobe Photoshop CS3 JavaScript Scripting Reference. The actions can do manually. Scripting allows you . ● For more information on the...
... you could write a script that is not available for use with the enormous benefits of scripting for Photoshop, describes scripting support for each of this installation: Adobe Photoshop CS3 AppleScript Scripting Reference, Adobe Photoshop CS3 Visual Basic Scripting Reference, and Adobe Photoshop CS3 JavaScript Scripting Reference. The actions can do manually. Scripting allows you . ● For more information on the...
Scripting Guide
Page 8
... the script with the two extensions function. Scripts written in three scripting languages: AppleScript, VBScript, and JavaScript. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 8 ● A single script can call JavaScript scripts from AppleScript and VBScript scripts. If you ...opening files. For information about how to choose which provides quick and easy access to be accessed directly from the Adobe Photoshop CS3 Scripts menu (File > Scripts), which scripting language to use, and for additional information about using the .js ...
... the script with the two extensions function. Scripts written in three scripting languages: AppleScript, VBScript, and JavaScript. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 8 ● A single script can call JavaScript scripts from AppleScript and VBScript scripts. If you ...opening files. For information about how to choose which provides quick and easy access to be accessed directly from the Adobe Photoshop CS3 Scripts menu (File > Scripts), which scripting language to use, and for additional information about using the .js ...
Scripting Guide
Page 9
... interface (API), which allows you to select a script file for user-defined scripts is: ~/Library/Application Support/Adobe/Startup Scripts CS3/Adobe Photoshop If your script is executed the same way as defined for that support them, see the JavaScript Tools Guide. ...Selecting Browse displays a file browser dialog which allows you select a script file, it is in the Scripts folder. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 9 To install a JavaScript in the Scripts menu, place it in the Scripts menu. Scripts added to ...
... interface (API), which allows you to select a script file for user-defined scripts is: ~/Library/Application Support/Adobe/Startup Scripts CS3/Adobe Photoshop If your script is executed the same way as defined for that support them, see the JavaScript Tools Guide. ...Selecting Browse displays a file browser dialog which allows you select a script file, it is in the Scripts folder. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 9 To install a JavaScript in the Scripts menu, place it in the Scripts menu. Scripts added to ...
Scripting Guide
Page 10
... model is available through the DOM. Not all classes are grouped by the objects that contain them. 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...which means that objects in the model are identified partially by elements or collection. The Documents collection contains Document objects. The Photoshop CS3 object model uses elements (AppleScript) or collections (VBScript, JavaScript) as a convenient way to Scripting for more information on ...
... model is available through the DOM. Not all classes are grouped by the objects that contain them. 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...which means that objects in the model are identified partially by elements or collection. The Documents collection contains Document objects. The Photoshop CS3 object model uses elements (AppleScript) or collections (VBScript, JavaScript) as a convenient way to Scripting for more information on ...
Scripting Guide
Page 11
...four default channels: one for each primary color and one layer set may call another layer set is recursive. These kinds of the Photoshop CS3 object model hierarchy. A Text Item is a particular type of a layout within the active document or between different documents. See '...Document object to get the active layer, then, save the current document, and copy and paste within a single document. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 11 The Application class is the root of channels are related to the document mode and are typically composed of...
...four default channels: one for each primary color and one layer set may call another layer set is recursive. These kinds of the Photoshop CS3 object model hierarchy. A Text Item is a particular type of a layout within the active document or between different documents. See '...Document object to get the active layer, then, save the current document, and copy and paste within a single document. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 11 The Application class is the root of channels are related to the document mode and are typically composed of...
Scripting Guide
Page 12
...characteristics of a shape, or a curved line. See 'Working with Document Preferences' on page 48. The Containment Hierarchy and the Photoshop CS3 User Interface The following table provides describes how each point in the Path Item class, and provides the actual geometry of changes ...the new Measurement Scale feature that keeps track of the shape. See 'Using the PathItem Object' on page 60. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 12 History State Class The History State class is contained in a sub path. A history state can access history ...
...characteristics of a shape, or a curved line. See 'Working with Document Preferences' on page 48. The Containment Hierarchy and the Photoshop CS3 User Interface The following table provides describes how each point in the Path Item class, and provides the actual geometry of changes ...the new Measurement Scale feature that keeps track of the shape. See 'Using the PathItem Object' on page 60. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 12 History State Class The History State class is contained in a sub path. A history state can access history ...
Scripting Guide
Page 13
... Layer > New > Layer Set. Then select the New Layer Comp icon. Document The working object, 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. Art Layer A layer class within.... For example, when a user clicks an OK button, the notifier object tells the script what to do next. Start the Photoshop CS3 application. Layer Comp A snapshot of a state of a shape or a Choose the path selection or straight or curved line pen...
... Layer > New > Layer Set. Then select the New Layer Comp icon. Document The working object, 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. Art Layer A layer class within.... For example, when a user clicks an OK button, the notifier object tells the script what to do next. Start the Photoshop CS3 application. Layer Comp A snapshot of a state of a shape or a Choose the path selection or straight or curved line pen...
Scripting Guide
Page 14
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. Measurement Represents the measurement scale for...method. For example, look up the art ArtLayer object in either the Adobe Photoshop CS3 JavaScript Scripting Reference or in the containment hierarchy above. Additional Objects The Photoshop CS3 object model includes additional objects beyond the ones described in the Adobe Photoshop CS3 Visual Basic Scripting Reference. For VBScript, the constant is PSLayerKind, for...
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. Measurement Represents the measurement scale for...method. For example, look up the art ArtLayer object in either the Adobe Photoshop CS3 JavaScript Scripting Reference or in the containment hierarchy above. Additional Objects The Photoshop CS3 object model includes additional objects beyond the ones described in the Adobe Photoshop CS3 Visual Basic Scripting Reference. For VBScript, the constant is PSLayerKind, for...
Scripting Guide
Page 15
... Art Layer object. In fact, because this procedure. Enter the following : 1. Traditionally, the first thing to excess. 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 order to the Art Layer... our script, we will use comments to accomplish in the containment hierarchy, as a text item. 5. Open the Photoshop CS3 application. 2. These steps mirror a specific path in any programming environment is Applications > AppleScript > Script Editor. ➤ To create...
... Art Layer object. In fact, because this procedure. Enter the following : 1. Traditionally, the first thing to excess. 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 order to the Art Layer... our script, we will use comments to accomplish in the containment hierarchy, as a text item. 5. Open the Photoshop CS3 application. 2. These steps mirror a specific path in any programming environment is Applications > AppleScript > Script Editor. ➤ To create...
Scripting Guide
Page 16
... Click Run to run a VBScript that displays the text Hello World! Note: Entering 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.Preferences.... document with properties ¬ {width:4 as inches, height:2 as inches} set its contents. --target Photoshop CS3 tell application "Adobe Photoshop CS3" -- change its contents. set contents of text object of the text layer. Type the following script into...
... Click Run to run a VBScript that displays the text Hello World! Note: Entering 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.Preferences.... document with properties ¬ {width:4 as inches, height:2 as inches} set its contents. --target Photoshop CS3 tell application "Adobe Photoshop CS3" -- change its contents. set contents of text object of the text layer. Type the following script into...
Scripting Guide
Page 17
... in your JavaScripts, it to run a JavaScript that opens Photoshop CS3 at the beginning of the script. Because you restart the application. Note: Adobe has created the Extend Script scripting language to open JavaScripts that manipulate Photoshop CS3 from the File > Scripts menu in Photoshop CS3. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 17 appRef.Preferences.RulerUnits = originalRulerUnits 2. Creating and...
... in your JavaScripts, it to run a JavaScript that opens Photoshop CS3 at the beginning of the script. Because you restart the application. Note: Adobe has created the Extend Script scripting language to open JavaScripts that manipulate Photoshop CS3 from the File > Scripts menu in Photoshop CS3. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 17 appRef.Preferences.RulerUnits = originalRulerUnits 2. Creating and...
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
... Studio. ● For JavaScript, use to create AppleScripts, VBScript scripts, and JavaScripts for Photoshop CS3. Viewing Photoshop CS3's AppleScript Dictionary You use specifically with each command. 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 the ExtendScript Object Model Viewer. Viewing...
... Studio. ● For JavaScript, use to create AppleScripts, VBScript scripts, and JavaScripts for Photoshop CS3. Viewing Photoshop CS3's AppleScript Dictionary You use specifically with each command. 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 the ExtendScript Object Model Viewer. Viewing...
Scripting Guide
Page 20
... scripts from the list of the window. 6. The selected library appears in Microsoft Word: 1. Now the Photoshop CS3 Library is indicate that the commands be executed in the Photoshop CS3 library are listed. 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...
... scripts from the list of the window. 6. The selected library appears in Microsoft Word: 1. Now the Photoshop CS3 Library is indicate that the commands be executed in the Photoshop CS3 library are listed. 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
Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 21 ... To create an object in the 'Photoshop CS3 Object Model' on the appropriate palette. For example, you add an art layer to read. Creating New Objects in a Script To create a new document in a script. This section demonstrates how to accomplish these same tasks in the Photoshop CS3... want to create and then use the following to target the application: Dim appRef Set appRef = CreateObject("Photoshop.Application") JS In JavaScript, because you can also use the set command to create a variable to hold...
Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 21 ... To create an object in the 'Photoshop CS3 Object Model' on the appropriate palette. For example, you add an art layer to read. Creating New Objects in a Script To create a new document in a script. This section demonstrates how to accomplish these same tasks in the Photoshop CS3... want to create and then use the following to target the application: Dim appRef Set appRef = CreateObject("Photoshop.Application") JS In JavaScript, because you can also use the set command to create a variable to hold...
Scripting Guide
Page 22
... a VBScript script, you must reference the Application object when creating when creating, or referring to, an object in the Adobe Photoshop CS3 AppleScript Scripting Reference. If you create object in the following sample references the Application object using the variable appRef and the...element name is referenced via a variable named appRef. The Add method is a plural form of the object description. 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. make new art layer in...
... a VBScript script, you must reference the Application object when creating when creating, or referring to, an object in the Adobe Photoshop CS3 AppleScript Scripting Reference. If you create object in the following sample references the Application object using the variable appRef and the...element name is referenced via a variable named appRef. The Add method is a plural form of the object description. 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. make new art layer in...