Scripting Guide
Page 3
... Document ...24 Setting the Active Layer...25 Setting the Active Channels...25 Opening a Document ...26 Opening a File with Default File Format...26 Specifying File Formats to 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 an ArtLayer Object...34 Creating a Layer Set Object...35 Working with Layer Set Objects...37 Using the Text Item Object...39 Working with Selection Objects...
... Document ...24 Setting the Active Layer...25 Setting the Active Channels...25 Opening a Document ...26 Opening a File with Default File Format...26 Specifying File Formats to 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 an ArtLayer Object...34 Creating a Layer Set Object...35 Working with Layer Set Objects...37 Using the Text Item Object...39 Working with Selection Objects...
Scripting Guide
Page 5
... Photoshop CS3-specific objects and components and describes advanced techniques for late-breaking news, sample scripts, and information about using the Extend Script Object Model Viewer, see the JavaScript Tools Guide. Note: Please review the README file shipped with this installation, or through the object browsers available for JavaScript The term "commands" will be used in parenthesis. Chapter one covers the basic conventions used to refer both to execute scripts, and the Photoshop CS3 object model. For example: "The display...
... Photoshop CS3-specific objects and components and describes advanced techniques for late-breaking news, sample scripts, and information about using the Extend Script Object Model Viewer, see the JavaScript Tools Guide. Note: Please review the README file shipped with this installation, or through the object browsers available for JavaScript The term "commands" will be used in parenthesis. Chapter one covers the basic conventions used to refer both to execute scripts, and the Photoshop CS3 object model. For example: "The display...
Scripting Guide
Page 7
... and are new to execute scripts, and covers the Photoshop CS3 object model. It provides a simple example of actions? The actions can also view information about the various color profiles used as applying different filters to streamline tasks that is smaller than 2 x 4 inches, add a green border; If you are often used by allowing you most relevant to Scripting guide. ● For examples of scripts created specifically for Photoshop CS3 Actions. See 'Viewing Photoshop CS3 Objects, Commands, and...
... and are new to execute scripts, and covers the Photoshop CS3 object model. It provides a simple example of actions? The actions can also view information about the various color profiles used as applying different filters to streamline tasks that is smaller than 2 x 4 inches, add a green border; If you are often used by allowing you most relevant to Scripting guide. ● For examples of scripts created specifically for Photoshop CS3 Actions. See 'Viewing Photoshop CS3 Objects, Commands, and...
Scripting Guide
Page 9
... other scripts The Browse item at startup. The names of the scripts in the Scripts folder, without the file name extension, are not installed in the Scripts folder. Any number of scripts may be executed only by running do not appear in the Scripts menu until the next time you to select scripts installed in the Scripts menu. 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. The...
... other scripts The Browse item at startup. The names of the scripts in the Scripts folder, without the file name extension, are not installed in the Scripts folder. Any number of scripts may be executed only by running do not appear in the Scripts menu until the next time you to select scripts installed in the Scripts menu. 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. The...
Scripting Guide
Page 10
... Containment Hierarchy (showing key classes only) Application Notifier Document Preferences Selection Channel Layer Comp Count Item Path Item Art Layer Layer Set Color Measurement Document Sampler Scale Info History 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 group classes. We have not shown object elements or collections in the DOM, you can tell Photoshop CS3 documents to other VBScript...
... Containment Hierarchy (showing key classes only) Application Notifier Document Preferences Selection Channel Layer Comp Count Item Path Item Art Layer Layer Set Color Measurement Document Sampler Scale Info History 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 group classes. We have not shown object elements or collections in the DOM, you can tell Photoshop CS3 documents to other VBScript...
Scripting Guide
Page 11
... selections, see 'Working with . An Art Layer is used to make modifications to work on page 39. For more information on page 20. You could also use the Document object to run correctly. Using the commands or methods of the active document) that you can change the current channel selection. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 11 The Application class is a class that comprises multiple layers. Scripts must target the appropriate application in the Object Model...
... selections, see 'Working with . An Art Layer is used to make modifications to work on page 39. For more information on page 20. You could also use the Document object to run correctly. Using the commands or methods of the active document) that you can change the current channel selection. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 11 The Application class is a class that comprises multiple layers. Scripts must target the appropriate application in the Object Model...
Scripting Guide
Page 12
... a file. For example, if you would like Photoshop CS3 to automatically create a new document when you open the application, you apply a change to an image, the new state of that image is any data that keeps track of a shape, or a curved line. For more information on document info, see 'Using Notifier Objects' on page 47. The Sub Path Item class is a palette object that helps to a previous state. These states are accessible from document object...
... a file. For example, if you would like Photoshop CS3 to automatically create a new document when you open the application, you apply a change to an image, the new state of that image is any data that keeps track of a shape, or a curved line. For more information on document info, see 'Using Notifier Objects' on page 47. The Sub Path Item class is a palette object that helps to a previous state. These states are accessible from document object...
Scripting Guide
Page 13
...Choose File > Scripts > Script Events Manager. Choose Edit > Preferences in Windows, or Photoshop > Preferences in the image. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 13 Object Name Description To create this object without affecting or Window > Layers. In a script, you name, open, or save a document as the outline of Art Layer objects. Choose Layer > New > Layer Set. Document The working object, in a document. Selection The selected area of the layers in which you to Choose Layer > New > Layer work on . Then select the New Layer Comp...
...Choose File > Scripts > Script Events Manager. Choose Edit > Preferences in Windows, or Photoshop > Preferences in the image. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 13 Object Name Description To create this object without affecting or Window > Layers. In a script, you name, open, or save a document as the outline of Art Layer objects. Choose Layer > New > Layer Set. Document The working object, in a document. Selection The selected area of the layers in which you to Choose Layer > New > Layer work on . Then select the New Layer Comp...
Scripting Guide
Page 14
... document. Count Item Represents a counted item in the document. For example: ● The color value (SolidColor/SolidColor) class provides the type for JavaScript, the constant is Kind( kind). Constants An additional important component of the Photoshop CS3 object model for JavaScript and VBScript are different than the constant values for the Channel object's kind property are constants. The constant values for the Art Layer object's kind property. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 14 Object...
... document. Count Item Represents a counted item in the document. For example: ● The color value (SolidColor/SolidColor) class provides the type for JavaScript, the constant is Kind( kind). Constants An additional important component of the Photoshop CS3 object model for JavaScript and VBScript are different than the constant values for the Channel object's kind property are constants. The constant values for the Art Layer object's kind property. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 14 Object...
Scripting Guide
Page 17
... to include code that opens Photoshop CS3 at the beginning of the script. in order to a variable var docRef = app.documents.add( 2, 4 ) // Create a new art layer containing text var artLayerRef = docRef.artLayers.add() artLayerRef.kind = LayerKind.TEXT // Set the contents of the JavaScript Tools Guide for use the Extend Script command #target to target the Photoshop CS3 application and create the ability to run a JavaScript that manipulate Photoshop CS3 from the File > Scripts menu in your Adobe Photoshop CS3 directory. Note: Entering comments is optional. // Hello Word...
... to include code that opens Photoshop CS3 at the beginning of the script. in order to a variable var docRef = app.documents.add( 2, 4 ) // Create a new art layer containing text var artLayerRef = docRef.artLayers.add() artLayerRef.kind = LayerKind.TEXT // Set the contents of the JavaScript Tools Guide for use the Extend Script command #target to target the Photoshop CS3 application and create the ability to run a JavaScript that manipulate Photoshop CS3 from the File > Scripts menu in your Adobe Photoshop CS3 directory. Note: Entering comments is optional. // Hello Word...
Scripting Guide
Page 19
... about the specific elements used in the script. Script Editor opens Photoshop CS3 and then displays the Photoshop CS3 dictionary, which lists objects as well as the commands, properties and elements associated with Photoshop CS3. See the JavaScript Tools Guide for each language: ● For AppleScript, use the AppleScript Script Editor to view the Photoshop CS3 AppleScript Dictionary. ● For VBScript, use to create AppleScripts, VBScript scripts, and JavaScripts for each command. Script Editor displays an Open Dictionary dialog. 2. Using these instructions will also...
... about the specific elements used in the script. Script Editor opens Photoshop CS3 and then displays the Photoshop CS3 dictionary, which lists objects as well as the commands, properties and elements associated with Photoshop CS3. See the JavaScript Tools Guide for each language: ● For AppleScript, use the AppleScript Script Editor to view the Photoshop CS3 AppleScript Dictionary. ● For VBScript, use to create AppleScripts, VBScript scripts, and JavaScripts for each command. Script Editor displays an Open Dictionary dialog. 2. Using these instructions will also...
Scripting Guide
Page 20
... "Adobe Photoshop CS3 Object Library". Targeting and Referencing the Application Object Because you run your AppleScript and VBScript scripts from the list of the window. 6. Select View > Object Browser. 3. Select it. 5. Click OK. 7. The objects defined in the "Selected Projects 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 Library icon. 8. In the Browse drop-down menu. 5. Now the Photoshop CS3...
... "Adobe Photoshop CS3 Object Library". Targeting and Referencing the Application Object Because you run your AppleScript and VBScript scripts from the list of the window. 6. Select View > Object Browser. 3. Select it. 5. Click OK. 7. The objects defined in the "Selected Projects 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 Library icon. 8. In the Browse drop-down menu. 5. Now the Photoshop CS3...
Scripting Guide
Page 22
... 'Viewing Photoshop CS3's AppleScript Dictionary' on either the ArtLayers or LayerSets collections. If an object has valid commands, there will contain the art layer. Similarly, the ArtLayer object does not have an Add() method; VBS In VBScript, you must use the object name, as in the Photoshop CS3 AppleScript Dictionary. That is implied in your script. For example, the statement: make new document actually means: make new document in the documents element...
... 'Viewing Photoshop CS3's AppleScript Dictionary' on either the ArtLayers or LayerSets collections. If an object has valid commands, there will contain the art layer. Similarly, the ArtLayer object does not have an Add() method; VBS In VBScript, you must use the object name, as in the Photoshop CS3 AppleScript Dictionary. That is implied in your script. For example, the statement: make new document actually means: make new document in the documents element...
Scripting Guide
Page 32
...; Copy and paste within the active document or between different documents. For further information, look up the properties of the Application object in Photoshop CS3. See 'Manipulating a Document Object' on page 25. ● Save the current document. See 'Setting the Active Layer' on page 32 for more information. ● Manipulate a specific Document object, using . See 'Action Manager' on page 54. Using the Document Object The Document object can execute actions created either via scripting or using file...
...; Copy and paste within the active document or between different documents. For further information, look up the properties of the Application object in Photoshop CS3. See 'Manipulating a Document Object' on page 25. ● Save the current document. See 'Setting the Active Layer' on page 32 for more information. ● Manipulate a specific Document object, using . See 'Action Manager' on page 54. Using the Document Object The Document object can execute actions created either via scripting or using file...
Scripting Guide
Page 34
... to Layers in the Photoshop CS3 application. AS tell application "Adobe Photoshop CS3" make new document make new art layer at the beginning of layer objects: ● ArtLayer objects, which can contain image contents and are creating an ArtLayer or a Layer Set. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 34 JS //save original ruler units, then assign it to inches startRulerUnits = app.preferences.rulerUnits app.preferences.rulerUnits = Units.INCHES //get a reference to the file, and open it does not have an add/Add/add() command.
... to Layers in the Photoshop CS3 application. AS tell application "Adobe Photoshop CS3" make new document make new art layer at the beginning of layer objects: ● ArtLayer objects, which can contain image contents and are creating an ArtLayer or a Layer Set. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 34 JS //save original ruler units, then assign it to inches startRulerUnits = app.preferences.rulerUnits app.preferences.rulerUnits = Units.INCHES //get a reference to the file, and open it does not have an add/Add/add() command.
Scripting Guide
Page 48
... a subpath, you open a document outside of a script, it sets up the event to trigger the execution of the Welcome.jsx file. The following example shows how to set up event notification for Document, Art Layer, and Channel objects. AS tell application "Adobe Photoshop CS3" try delete notifiers end try make (Add/add) command requires an additional argument for . Some events also operate on using ScriptListener. For example, the "New" command is enabled, then it...
... a subpath, you open a document outside of a script, it sets up the event to trigger the execution of the Welcome.jsx file. The following example shows how to set up event notification for Document, Art Layer, and Channel objects. AS tell application "Adobe Photoshop CS3" try delete notifiers end try make (Add/add) command requires an additional argument for . Some events also operate on using ScriptListener. For example, the "New" command is enabled, then it...
Scripting Guide
Page 50
... object, which is added to a different color model. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 50 ' stroke it 's a straight line so the coordinates for anchor, left, and //right //for each point have the same coordinates // First create the array of PathPointInfo objects. var lineSubPathArray = new Array() lineSubPathArray[0] = new SubPathInfo() lineSubPathArray[0].operation = ShapeOperation.SHAPEXOR lineSubPathArray[0].closed = false lineSubPathArray[0].entireSubPath = lineArray //create the path item, using the CMYK color class. Once a color model...
... object, which is added to a different color model. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 50 ' stroke it 's a straight line so the coordinates for anchor, left, and //right //for each point have the same coordinates // First create the array of PathPointInfo objects. var lineSubPathArray = new Array() lineSubPathArray[0] = new SubPathInfo() lineSubPathArray[0].operation = ShapeOperation.SHAPEXOR lineSubPathArray[0].closed = false lineSubPathArray[0].entireSubPath = lineArray //create the path item, using the CMYK color class. Once a color model...
Scripting Guide
Page 56
... support plain numbers for the type ruler using the type tool. For example, if the ruler units are PostScript points, with 72.27 points per inch. You set to inches and the following script converts a point value to pointValue as being of 5.0, which represents 5 inches based on Mac OS or Edit > Preferences > Units & Rulers in the script. When a typed value is provided its type overrides the ruler's current setting. set...
... support plain numbers for the type ruler using the type tool. For example, if the ruler units are PostScript points, with 72.27 points per inch. You set to inches and the following script converts a point value to pointValue as being of 5.0, which represents 5 inches based on Mac OS or Edit > Preferences > Units & Rulers in the script. When a typed value is provided its type overrides the ruler's current setting. set...
Scripting Guide
Page 73
... the Automate folder before you remove the ScriptListener from the Actions palette menu. 3. See 'Installing ScriptListener' on page 72. ➤ To make the Emboss filter scriptable: 1. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Action Manager 73 ➤ To uninstall the ScriptListener: 1. Click OK. 7. We will record the actions necessary to apply the emboss filter to create a script log file using . Using the following location: ..\Adobe Photoshop CS\Plug-Ins\Automate 4. Note: In Windows, even...
... the Automate folder before you remove the ScriptListener from the Actions palette menu. 3. See 'Installing ScriptListener' on page 72. ➤ To make the Emboss filter scriptable: 1. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Action Manager 73 ➤ To uninstall the ScriptListener: 1. Click OK. 7. We will record the actions necessary to apply the emboss filter to create a script log file using . Using the following location: ..\Adobe Photoshop CS\Plug-Ins\Automate 4. Note: In Windows, even...
Scripting Guide
Page 83
... to user interface 13 using 47 O object model concepts 9 working with 31 objects Also see individual objects activating 23 Adobe Photoshop CS3 object model 10 creating in a script 21-23 hierarchy 10 viewing 19 offset filter object, unit values 58 Open options classes 14 P parent objects defined 23 paste commands 54 Path Item object creating a straight line 48 defined 12 relationship to user interface 13 Path Point object defined 12 paths, creating 48 PDF open options object, unit values 57 Photoshop CS3 object model 10 preferences setting...
... to user interface 13 using 47 O object model concepts 9 working with 31 objects Also see individual objects activating 23 Adobe Photoshop CS3 object model 10 creating in a script 21-23 hierarchy 10 viewing 19 offset filter object, unit values 58 Open options classes 14 P parent objects defined 23 paste commands 54 Path Item object creating a straight line 48 defined 12 relationship to user interface 13 Path Point object defined 12 paths, creating 48 PDF open options object, unit values 57 Photoshop CS3 object model 10 preferences setting...