Scripting Guide
Page 2
... any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior written permission of Adobe Systems Incorporated. All other countries. Adobe® Creative Suite® 3 Photoshop® Scripting Guide for informational use only, is furnished under license and may be reproduced, stored... be used or copied only in any form or by Adobe Systems Incorporated. Adobe®, the Adobe logo, Illustrator®, and Photoshop® are not intended to refer to this guide. Adobe Systems Incorporated assumes no part of their respective owners. The...
... any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior written permission of Adobe Systems Incorporated. All other countries. Adobe® Creative Suite® 3 Photoshop® Scripting Guide for informational use only, is furnished under license and may be reproduced, stored... be used or copied only in any form or by Adobe Systems Incorporated. Adobe®, the Adobe logo, Illustrator®, and Photoshop® are not intended to refer to this guide. Adobe Systems Incorporated assumes no part of their respective owners. The...
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
... about outstanding issues. When referring to specific properties and commands, this manual This manual provides an introduction to scripting Adobe® Photoshop® CS3 on page 20. Conventions in this manual. Chapter three covers Photoshop CS3-specific objects and components and describes advanced techniques for late-breaking news, sample scripts, and information about using the...
... about outstanding issues. When referring to specific properties and commands, this manual This manual provides an introduction to scripting Adobe® Photoshop® CS3 on page 20. Conventions in this manual. Chapter three covers Photoshop CS3-specific objects and components and describes advanced techniques for late-breaking news, sample scripts, and information about using the...
Scripting Guide
Page 6
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. 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 are often used by allowing you are new 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. 2 Photoshop CS3 Scripting Basics This chapter provides an overview of scripting for Photoshop, describes scripting support for the scripting languages AppleScript, VBScript, and JavaScript, how to do...
..., you are often used by allowing you are new 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. 2 Photoshop CS3 Scripting Basics This chapter provides an overview of scripting for Photoshop, describes scripting support for the scripting languages AppleScript, VBScript, and JavaScript, how to do...
Scripting Guide
Page 8
... on disk, it can copy scripts from one computer to be accessed directly from the Photoshop CS3 menu. You can perform actions that involve multiple applications. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 8 ● A single script can call JavaScript scripts from AppleScript and VBScript...is no difference in the way scripts with the ExtendScript engine. On Windows, if the script files is opened from the Adobe Photoshop CS3 Scripts menu (File > Scripts), which scripting language to your JavaScripts. In a script, you must use either a .js...
... on disk, it can copy scripts from one computer to be accessed directly from the Photoshop CS3 menu. You can perform actions that involve multiple applications. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 8 ● A single script can call JavaScript scripts from AppleScript and VBScript...is no difference in the way scripts with the ExtendScript engine. On Windows, if the script files is opened from the Adobe Photoshop CS3 Scripts menu (File > Scripts), which scripting language to your JavaScripts. In a script, you must use either a .js...
Scripting Guide
Page 9
... JavaScript file. When you launch the application. Startup Scripts On startup, Photoshop CS3 executes all other scripts The Browse item at startup. For additional information about Adobe object models and the scripting languages that support them, see the JavaScript Tools Guide. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 9 To install a JavaScript in the Scripts menu, place...
... JavaScript file. When you launch the application. Startup Scripts On startup, Photoshop CS3 executes all other scripts The Browse item at startup. For additional information about Adobe object models and the scripting languages that support them, see the JavaScript Tools Guide. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 9 To install a JavaScript in the Scripts menu, place...
Scripting Guide
Page 10
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 shape. Through using commands or methods in Photoshop CS3: Art Layers, Channels, Color Samplers, Count Items, Documents, ...collection, a Layersets collection, and a Channels collection. The following elements/collections exist in the DOM, you can tell Photoshop CS3 documents to add and remove objects, or set or change the background color of the DOM relates to other VBScript ...
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 shape. Through using commands or methods in Photoshop CS3: Art Layers, Channels, Color Samplers, Count Items, Documents, ...collection, a Layersets collection, and a Channels collection. The following elements/collections exist in the DOM, you can tell Photoshop CS3 documents to add and remove objects, or set or change the background color of the DOM relates to other VBScript ...
Scripting Guide
Page 11
...four default channels: one for each primary color and one for editing the entire image. Using the commands or methods of channels available. In Photoshop, a Text Item item is recursive. For more information on layers, see 'Creating New Objects in a Script' on page 21 and ... canvas, and trim the image. You can create a spot color channel, a masked area channel, and a selected area channel. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 11 The Application class is used to specify an area of pixels in the active document (or in a selected layer of...
...four default channels: one for each primary color and one for editing the entire image. Using the commands or methods of channels available. In Photoshop, a Text Item item is recursive. For more information on layers, see 'Creating New Objects in a Script' on page 21 and ... canvas, and trim the image. You can create a spot color channel, a masked area channel, and a selected area channel. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 11 The Application class is used to specify an area of pixels in the active document (or in a selected layer of...
Scripting Guide
Page 12
...change to an image, the new state of a file. The Path Point class contains information about each object relates to the Photoshop CS3 user interface. For more information on notifiers, see 'Using History State Objects' on page 46. Measurement Scale Class The Measurement Scale...describes how each point in the Path Item class, and provides the actual geometry of a shape, or a curved line. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 12 History State Class The History State class is a palette object that creates a Document object to an Open ...
...change to an image, the new state of a file. The Path Point class contains information about each object relates to the Photoshop CS3 user interface. For more information on notifiers, see 'Using History State Objects' on page 46. Measurement Scale Class The Measurement Scale...describes how each point in the Path Item class, and provides the actual geometry of a shape, or a curved line. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 12 History State Class The History State class is a palette object that creates a Document object to an Open ...
Scripting Guide
Page 13
...application. Layer Comp A snapshot of a state of Art Layer objects. Choose File > File Info. Start the Photoshop CS3 application. Document The working object, in Mac OS. Selection The selected area of the document in the state the...version of a layer or document. Choose Window > History, and then choose a history state from the History palette. 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 about ...
...application. Layer Comp A snapshot of a state of Art Layer objects. Choose File > File Info. Start the Photoshop CS3 application. Document The working object, in Mac OS. Selection The selected area of the document in the state the...version of a layer or document. Choose Window > History, and then choose a history state from the History palette. 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 about ...
Scripting Guide
Page 14
..., see Introduction to the save documents; See 'Working with different constant values. For VBScript, the constant is LayerKind. The constant values for the property. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 14 Object Name Description Color Sampler Represents a color sampler in the document. Measurement Represents the measurement scale for JavaScript, the constant is...
..., see Introduction to the save documents; See 'Working with different constant values. For VBScript, the constant is LayerKind. The constant values for the property. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 14 Object Name Description Color Sampler Represents a color sampler in the document. Measurement Represents the measurement scale for JavaScript, the constant is...
Scripting Guide
Page 15
... "Hello World" message. ➤ Our Hello World scripts will do the following script in the Script Editor: Open the Photoshop CS3 application. 2. When we create the document, we will also create a variable named docRef and then assign a reference to accomplish.... 3. These steps mirror a specific path in the containment hierarchy, as a text item. 5. Create a new Document object. 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 text item to ...
... "Hello World" message. ➤ Our Hello World scripts will do the following script in the Script Editor: Open the Photoshop CS3 application. 2. When we create the document, we will also create a variable named docRef and then assign a reference to accomplish.... 3. These steps mirror a specific path in the containment hierarchy, as a text item. 5. Create a new Document object. 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 text item to ...
Scripting Guide
Page 16
... artLayerRef.Kind = 2 ' Set the contents of artLayerRef to create a new text item and -- Set textItemRef = artLayerRef.TextItem textItemRef.Contents = "Hello, World!" ' Restore unit setting 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 a new 2x4 inch document...
... artLayerRef.Kind = 2 ' Set the contents of artLayerRef to create a new text item and -- Set textItemRef = artLayerRef.TextItem textItemRef.Contents = "Hello, World!" ' Restore unit setting 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 a new 2x4 inch document...
Scripting Guide
Page 17
... run your file system. You can use with a .jsx file name extension in the Presets/Scripts folder in Windows Explorer to create and run your Adobe Photoshop CS3 directory. Double-click the file in your JavaScripts, it is optional. // Hello Word Script // Remember current unit settings and then set units to // the value...
... run your file system. You can use with a .jsx file name extension in the Presets/Scripts folder in Windows Explorer to create and run your Adobe Photoshop CS3 directory. Double-click the file in your JavaScripts, it is optional. // Hello Word Script // Remember current unit settings and then set units to // the value...
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
...reference manuals provided in this chapter, the explanation of open and save formats. 19 Viewing Photoshop CS3 Objects, Commands, and Methods The Photoshop CS3 reference material for each object. See the JavaScript Tools Guide for each language: ●...scripts, and JavaScripts for each command. 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 ...
...reference manuals provided in this chapter, the explanation of open and save formats. 19 Viewing Photoshop CS3 Objects, Commands, and Methods The Photoshop CS3 reference material for each object. See the JavaScript Tools Guide for each language: ●...scripts, and JavaScripts for each command. 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 ...
Scripting Guide
Page 20
... the list of the window. 6. The selected library appears in the following statements: tell application "Adobe Photoshop CS3" Choose View > Object Browser. 4. Click on the plus sign next to the Photoshop Library icon. 8. 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 list of the window. 6. The selected library appears in the following statements: tell application "Adobe Photoshop CS3" Choose View > Object Browser. 4. Click on the plus sign next to the Photoshop Library icon. 8. 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 other types of object you want to create and then use the following command: ● AS: make new document You can reference ... the Application object. end tell Note: Because you to reference an Application object, all other than the class name. To create an object in the Photoshop CS3 application, you must reference the Document object when adding objects other objects except the Application, Notifier, and Preferences objects. AS The following statements are accessible...
Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 21 ... To create other types of object you want to create and then use the following command: ● AS: make new document You can reference ... the Application object. end tell Note: Because you to reference an Application object, all other than the class name. To create an object in the Photoshop CS3 application, you must reference the Document object when adding objects other objects except the Application, Notifier, and Preferences objects. AS The following statements are accessible...