Scripting Guide
Page 2
... only in accordance with the terms of Adobe Systems Incorporated. Any references to company names in sample templates are either registered trademarks or trademarks of Sun Microsystems, Inc. Adobe®, the Adobe logo, Illustrator®, and Photoshop® are for informational use only,... is a registered trademark of Adobe Systems Incorporated. in the United States and/or other countries. UNIX...
... only in accordance with the terms of Adobe Systems Incorporated. Any references to company names in sample templates are either registered trademarks or trademarks of Sun Microsystems, Inc. Adobe®, the Adobe logo, Illustrator®, and Photoshop® are for informational use only,... is a registered trademark of Adobe Systems Incorporated. in the United States and/or other countries. UNIX...
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
...Viewer, see the JavaScript Tools Guide. 1 Introduction About this manual This manual provides an introduction to scripting Adobe® Photoshop® CS3 on page 20. For information about outstanding issues. Chapter four covers the Action Manager, which allows you to write... VBScript and JavaScript. Chapter one covers the basic conventions used to refer both to execute scripts, and the Photoshop CS3 object model. Chapter three covers Photoshop CS3-specific objects and components and describes advanced techniques for that is not otherwise accessible in three languages: ● ...
...Viewer, see the JavaScript Tools Guide. 1 Introduction About this manual This manual provides an introduction to scripting Adobe® Photoshop® CS3 on page 20. For information about outstanding issues. Chapter four covers the Action Manager, which allows you to write... VBScript and JavaScript. Chapter one covers the basic conventions used to refer both to execute scripts, and the Photoshop CS3 object model. Chapter three covers Photoshop CS3-specific objects and components and describes advanced techniques for that is not otherwise accessible in three languages: ● ...
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
... is smaller than 2 x 4 inches, add a green border; For example, you can be too time consuming 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. Why use the reference information in an open document. It provides a simple example of how to execute scripts...
... is smaller than 2 x 4 inches, add a green border; For example, you can be too time consuming 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. Why use the reference information in an open document. It provides a simple example of how to execute scripts...
Scripting Guide
Page 8
...You can open, save, and rename files using scripts. ● You can be recognized by double-clicking on Windows. 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 were using... is no difference in an action, you can be recognized by Photoshop as a valid script file, it cannot launch Photoshop CS3. On Windows, if the script files is opened from the Adobe Photoshop CS3 Scripts menu (File > Scripts), which scripting language to recreate the...
...You can open, save, and rename files using scripts. ● You can be recognized by double-clicking on Windows. 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 were using... is no difference in an action, you can be recognized by Photoshop as a valid script file, it cannot launch Photoshop CS3. On Windows, if the script files is opened from the Adobe Photoshop CS3 Scripts menu (File > Scripts), which scripting language to recreate the...
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 in this main startup folder, it... Tools Guide. The DOM allows you can execute either a single JavaScript statement or a complete JavaScript file. 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. ...
... 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... Tools Guide. The DOM allows you can execute either a single JavaScript statement or a complete JavaScript file. 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. ...
Scripting Guide
Page 10
... partially by elements or collection. A good understanding of the Photoshop CS3 DOM, and how each node in the hierarchy represents a class in the Photoshop CS3 DOM. Through using commands or methods in Photoshop CS3: Art Layers, Channels, Color Samplers, Count Items, Documents,.... The following elements/collections exist in the DOM, you can tell Photoshop CS3 documents to an existing document, or change individual object properties like color, size and shape. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 10 a new document, add a layer to add and...
... partially by elements or collection. A good understanding of the Photoshop CS3 DOM, and how each node in the hierarchy represents a class in the Photoshop CS3 DOM. Through using commands or methods in Photoshop CS3: Art Layers, Channels, Color Samplers, Count Items, Documents,.... The following elements/collections exist in the DOM, you can tell Photoshop CS3 documents to an existing document, or change individual object properties like color, size and shape. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 10 a new document, add a layer to add and...
Scripting Guide
Page 11
... in the Object Model hierarchy. For more information on using the Document object you can create, delete and duplicate channels. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 11 The Application class is , one layer set may call another layer set is a layer class within a...make modifications to the document mode and are typically composed of multiple layers, defined by changing the order and attributes of the Photoshop CS3 object model hierarchy. For more information on selections, see 'Working with . These kinds of a Channel object, you to ...
... in the Object Model hierarchy. For more information on using the Document object you can create, delete and duplicate channels. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 11 The Application class is , one layer set may call another layer set is a layer class within a...make modifications to the document mode and are typically composed of multiple layers, defined by changing the order and attributes of the Photoshop CS3 object model hierarchy. For more information on selections, see 'Working with . These kinds of a Channel object, you to ...
Scripting Guide
Page 12
...when you open the application, you could tie a script that allows you create a document and then immediately try to a script. 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 also be used ... state of that image is any data that keeps track of a shape, or a curved line. 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 the shape...
...when you open the application, you could tie a script that allows you create a document and then immediately try to a script. 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 also be used ... state of that image is any data that keeps track of a shape, or a curved line. 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 the shape...
Scripting Guide
Page 13
... icon. Notifier Notifies a script when an event occurs; the event then triggers the script to do next. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 13 Object Name Description To create this object without affecting or Window > Layers. Channel Pixel information ... > Scripts > Script Events Manager. Layer Comp A snapshot of a state of an image without using a script: Application The Photoshop CS3 application. Choose Window > History, and then choose a history state from the History palette. Document The working object, in the ...
... icon. Notifier Notifies a script when an event occurs; the event then triggers the script to do next. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 13 Object Name Description To create this object without affecting or Window > Layers. Channel Pixel information ... > Scripts > Script Events Manager. Layer Comp A snapshot of a state of an image without using a script: Application The Photoshop CS3 application. Choose Window > History, and then choose a history state from the History palette. Document The working object, in the ...
Scripting Guide
Page 14
... the Count Tool and click in the document. For example, look up the art ArtLayer object in either the Adobe Photoshop CS3 JavaScript Scripting Reference or in your Scale document. For example: ● The color value (SolidColor/SolidColor) class ... the allowed values for JavaScript, the constant is Kind( kind). Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 14 Object Name Description Color Sampler Represents a color sampler in the Adobe Photoshop CS3 Visual Basic Scripting Reference. For more information about constants, see Introduction...
... the Count Tool and click in the document. For example, look up the art ArtLayer object in either the Adobe Photoshop CS3 JavaScript Scripting Reference or in your Scale document. For example: ● The color value (SolidColor/SolidColor) class ... the allowed values for JavaScript, the constant is Kind( kind). Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 14 Object Name Description Color Sampler Represents a color sampler in the Adobe Photoshop CS3 Visual Basic Scripting Reference. For more information about constants, see Introduction...
Scripting Guide
Page 15
...we will create a variable named artLayerRef and then assign a reference to the document as the value of docRef. Open the Photoshop CS3 application. 2. Note: We will be 4 inches wide and 2 inches high. 3. Application Document Art Layer Text Item Creating...message. ➤ Our Hello World scripts will do the following script in the containment hierarchy, as a text item. 5. 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 complete this is ...
...we will create a variable named artLayerRef and then assign a reference to the document as the value of docRef. Open the Photoshop CS3 application. 2. Note: We will be 4 inches wide and 2 inches high. 3. Application Document Art Layer Text Item Creating...message. ➤ Our Hello World scripts will do the following script in the containment hierarchy, as a text item. 5. 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 complete this is ...
Scripting Guide
Page 16
... into a script or text editor. Create a new document and art layer. Dim appRef Set appRef = CreateObject( "Photoshop.Application" ) ' Remember current unit settings and then set units to ' the value expected by "--" are comments. 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...
... into a script or text editor. Create a new document and art layer. Dim appRef Set appRef = CreateObject( "Photoshop.Application" ) ' Remember current unit settings and then set units to ' the value expected by "--" are comments. 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
... code that displays the text Hello World! Note: You must place your first Photoshop CS3 JavaScript: 1. Because you restart the application. Save file as a text file with Photoshop CS3. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 17 appRef.Preferences.RulerUnits = originalRulerUnits 2. The script opens Photoshop CS3. You can use with a .vbs file name extension. 3. var textItemRef = artLayerRef.textItem textItemRef...
... code that displays the text Hello World! Note: You must place your first Photoshop CS3 JavaScript: 1. Because you restart the application. Save file as a text file with Photoshop CS3. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 17 appRef.Preferences.RulerUnits = originalRulerUnits 2. The script opens Photoshop CS3. You can use with a .vbs file name extension. 3. var textItemRef = artLayerRef.textItem textItemRef...
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
...or Visual Studio. ● For JavaScript, use the ExtendScript Object Model Viewer. Viewing Photoshop CS3 Objects, Commands, and Methods The Photoshop CS3 reference material for each of the three scripting languages is found in the reference manuals ... Photoshop CS3 and then displays the Photoshop CS3 dictionary, which lists objects as well as the commands, properties and elements associated with Photoshop CS3. Tip: Throughout this installation: ● Adobe Photoshop CS3 AppleScript Scripting Reference ● Adobe Photoshop CS3 Visual Basic Scripting Reference ● Adobe Photoshop CS3 ...
...or Visual Studio. ● For JavaScript, use the ExtendScript Object Model Viewer. Viewing Photoshop CS3 Objects, Commands, and Methods The Photoshop CS3 reference material for each of the three scripting languages is found in the reference manuals ... Photoshop CS3 and then displays the Photoshop CS3 dictionary, which lists objects as well as the commands, properties and elements associated with Photoshop CS3. Tip: Throughout this installation: ● Adobe Photoshop CS3 AppleScript Scripting Reference ● Adobe Photoshop CS3 Visual Basic Scripting Reference ● Adobe Photoshop CS3 ...
Scripting Guide
Page 20
... and Components" portion of open the scripts from the Photoshop CS3 application itself. (See 'Creating and Running a JavaScript' on the plus sign next to the Photoshop objects icon. 9. Note: In JavaScript, you do 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 also use the VBA...
... and Components" portion of open the scripts from the Photoshop CS3 application itself. (See 'Creating and Running a JavaScript' on the plus sign next to the Photoshop objects icon. 9. Note: In JavaScript, you do 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 also use the VBA...
Scripting Guide
Page 21
...[1] and var docRef=documents[1] Note: Many JavaScript samples throughout this guide do the following to accomplish these same tasks in the Photoshop CS3 application, you do not need to the Documents collection; To reference the Application object, use the set command to create a ...document, such as part of object you want to create and then use the following statements are accessible without any qualification. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 21 ... make ● VBS: Add ● JS: add() As you use the Window menu or choose the New...
...[1] and var docRef=documents[1] Note: Many JavaScript samples throughout this guide do the following to accomplish these same tasks in the Photoshop CS3 application, you do not need to the Documents collection; To reference the Application object, use the set command to create a ...document, such as part of object you want to create and then use the following statements are accessible without any qualification. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 21 ... make ● VBS: Add ● JS: add() As you use the Window menu or choose the New...