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
... issues. Chapter one covers the basic conventions used to refer both to scripting Adobe® Photoshop® CS3 on page 20. See 'Viewing Photoshop CS3's AppleScript Dictionary' on page 19 and 'Viewing Photoshop CS3's Type Library (VBS)' on Mac OS® and Windows®. Chapter... naming convention for that is part of these languages through the object browsers available for scripting the Photoshop CS3 application. Chapter three covers Photoshop CS3-specific objects and components and describes advanced techniques for each of the Application object." 5 Note: Please...
... issues. Chapter one covers the basic conventions used to refer both to scripting Adobe® Photoshop® CS3 on page 20. See 'Viewing Photoshop CS3's AppleScript Dictionary' on page 19 and 'Viewing Photoshop CS3's Type Library (VBS)' on Mac OS® and Windows®. Chapter... naming convention for that is part of these languages through the object browsers available for scripting the Photoshop CS3 application. Chapter three covers Photoshop CS3-specific objects and components and describes advanced techniques for each of the Application object." 5 Note: Please...
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 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 each scripting language. For larger blocks of code, scripting examples are sometimes used 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 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 each scripting language. For larger blocks of code, scripting examples are sometimes used to the JavaScript property.
Scripting Guide
Page 7
... to selections in an image: "If the selected area is not available 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. If you are often used Photoshop CS3 Actions, you could write a script that is smaller than 2 x 4 inches, add a green border; For example, you 're...
... to selections in an image: "If the selected area is not available 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. If you are often used Photoshop CS3 Actions, you could write a script that is smaller than 2 x 4 inches, add a green border; For example, you 're...
Scripting Guide
Page 8
...use either a .js or a .jsx extension. You can be recognized by double-clicking on it cannot launch Photoshop CS3. 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 provides quick and easy access to be accessed directly from the Adobe Photoshop CS3 Scripts menu (File > Scripts), which scripting language to another Adobe Creative Suite 3 Application, such as a valid script file, it can call JavaScript scripts...
...use either a .js or a .jsx extension. You can be recognized by double-clicking on it cannot launch Photoshop CS3. 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 provides quick and easy access to be accessed directly from the Adobe Photoshop CS3 Scripts menu (File > Scripts), which scripting language to another Adobe Creative Suite 3 Application, such as a valid script file, it can call JavaScript scripts...
Scripting Guide
Page 9
... to select a script file for user-defined scripts is: ~/Library/Application Support/Adobe/Startup Scripts CS3/Adobe Photoshop If your script is in the Scripts folder (Photoshop CS3 /Presets /Scripts). Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 9 To install a JavaScript in the Scripts menu, place it in... folders. ● On Windows, the startup folder for user-defined scripts is: C:\Program Files\Common Files\Adobe\Startup Scripts CS3\Adobe Photoshop ● On Mac OS, the startup folder for execution. Executing JavaScripts from AS or VBS You can ...
... to select a script file for user-defined scripts is: ~/Library/Application Support/Adobe/Startup Scripts CS3/Adobe Photoshop If your script is in the Scripts folder (Photoshop CS3 /Presets /Scripts). Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 9 To install a JavaScript in the Scripts menu, place it in... folders. ● On Windows, the startup folder for user-defined scripts is: C:\Program Files\Common Files\Adobe\Startup Scripts CS3\Adobe Photoshop ● On Mac OS, the startup folder for execution. Executing JavaScripts from AS or VBS You can ...
Scripting Guide
Page 10
..., Layers, Layer Comps, Layer Sets, History States, Notifiers, Path Items, Path Points Sub Path Items, and Text Fonts. Caution: In Photoshop, VBScript collections index from 0. . Most of the hierarchy. 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...
..., Layers, Layer Comps, Layer Sets, History States, Notifiers, Path Items, Path Points Sub Path Items, and Text Fonts. Caution: In Photoshop, VBScript collections index from 0. . Most of the hierarchy. 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...
Scripting Guide
Page 11
... that you to add type to create, manage, and view multiple versions of a Channel object, you to an image. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 11 The Application class is the root of channels available. See 'Targeting and Referencing the Application Object' on page... 32. For more information on page 41. Image color determines the number of the Photoshop CS3 object model hierarchy. These kinds of pixels in the active document (or in a Script' on page 21 and 'Using the ...
... that you to add type to create, manage, and view multiple versions of a Channel object, you to an image. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 11 The Application class is the root of channels available. See 'Targeting and Referencing the Application Object' on page... 32. For more information on page 41. Image color determines the number of the Photoshop CS3 object model hierarchy. These kinds of pixels in the active document (or in a Script' on page 21 and 'Using the ...
Scripting Guide
Page 12
...open the application, you can access history states. Metadata is any data that helps to the Photoshop CS3 user interface. For example, if you would like Photoshop CS3 to an Open Application event. Measurement Scale Class The Measurement Scale object provides scripting support for ...also be used to a previous state. A history state can be used to reset the document to fill a selection. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 12 History State Class The History State class is a palette object that keeps track of changes made to a...
...open the application, you can access history states. Metadata is any data that helps to the Photoshop CS3 user interface. For example, if you would like Photoshop CS3 to an Open Application event. Measurement Scale Class The Measurement Scale object provides scripting support for ...also be used to a previous state. A history state can be used to reset the document to fill a selection. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 12 History State Class The History State class is a palette object that keeps track of changes made to a...
Scripting Guide
Page 13
...a file, such filename, creation date and time, author name, the name of an image without using a script: Application The Photoshop CS3 application. Choose the marquee or lasso tools and drag your mouse. other elements in Mac OS. Choose File > File Info. ... about a Document object. Choose Window > Layer Comp. Layer Comp A snapshot of a state of Art Layer objects. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 13 Object Name Description To create this object without affecting or Window > Layers. Selection The selected area of ...
...a file, such filename, creation date and time, author name, the name of an image without using a script: Application The Photoshop CS3 application. Choose the marquee or lasso tools and drag your mouse. other elements in Mac OS. Choose File > File Info. ... about a Document object. Choose Window > Layer Comp. Layer Comp A snapshot of a state of Art Layer objects. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 13 Object Name Description To create this object without affecting or Window > Layers. Selection The selected area of ...
Scripting Guide
Page 14
...or method. 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. Additional Objects The Photoshop CS3 object model includes additional objects beyond the ones described in the Adobe Photoshop CS3 Visual Basic ... The constant values for your document. For example, look up the art ArtLayer object in either the Adobe Photoshop CS3 JavaScript Scripting Reference or in the containment hierarchy above. The value type for JavaScript, the constant is PSLayerKind...
...or method. 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. Additional Objects The Photoshop CS3 object model includes additional objects beyond the ones described in the Adobe Photoshop CS3 Visual Basic ... The constant values for your document. For example, look up the art ArtLayer object in either the Adobe Photoshop CS3 JavaScript Scripting Reference or in the containment hierarchy above. The value type for JavaScript, the constant is PSLayerKind...
Scripting Guide
Page 15
Open the Photoshop CS3 application. 2. When we create the document, we will use comments to the document as the value of artLayerRef. 4. Define artLayerRef as ... mirror a specific path in any programming environment is Applications > AppleScript > Script Editor. ➤ To create and run your first Photoshop CS3 AppleScript: 1. Enter the following : 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 the Script Editor: The document will do...
Open the Photoshop CS3 application. 2. When we create the document, we will use comments to the document as the value of artLayerRef. 4. Define artLayerRef as ... mirror a specific path in any programming environment is Applications > AppleScript > Script Editor. ➤ To create and run your first Photoshop CS3 AppleScript: 1. Enter the following : 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 the Script Editor: The document will do...
Scripting Guide
Page 16
... World! Creating and Running a VBScript Follow these steps to a variable. Dim appRef Set appRef = CreateObject( "Photoshop.Application" ) ' Remember current unit settings and then set artLayerRef to "Hello, World" end tell 2. set its contents. --target Photoshop CS3 tell application "Adobe Photoshop CS3" -- Get a reference to the text object and set kind of artLayerRef to make new document...
... World! Creating and Running a VBScript Follow these steps to a variable. Dim appRef Set appRef = CreateObject( "Photoshop.Application" ) ' Remember current unit settings and then set artLayerRef to "Hello, World" end tell 2. set its contents. --target Photoshop CS3 tell application "Adobe Photoshop CS3" -- Get a reference to the text object and set kind of artLayerRef to make new document...
Scripting Guide
Page 17
...the Extend Script command #target to target the Photoshop CS3 application and create the ability to include code that manipulate Photoshop CS3 from the File > Scripts menu in your Adobe Photoshop CS3 directory. var textItemRef = artLayerRef.textItem textItemRef.contents...text var artLayerRef = docRef.artLayers.add() artLayerRef.kind = LayerKind.TEXT // Set the contents of the script. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 17 appRef.Preferences.RulerUnits = originalRulerUnits 2. Note: Entering comments is optional. // Hello Word Script //...
...the Extend Script command #target to target the Photoshop CS3 application and create the ability to include code that manipulate Photoshop CS3 from the File > Scripts menu in your Adobe Photoshop CS3 directory. var textItemRef = artLayerRef.textItem textItemRef.contents...text var artLayerRef = docRef.artLayers.add() artLayerRef.kind = LayerKind.TEXT // Set the contents of the script. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 17 appRef.Preferences.RulerUnits = originalRulerUnits 2. Note: Entering comments is optional. // Hello Word Script //...
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
... to create a script is Applications > AppleScript > Script Editor. ➤ To view the AppleScript dictionary: 1. 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 use specifically with each command. Script Editor displays an...
... to create a script is Applications > AppleScript > Script Editor. ➤ To view the AppleScript dictionary: 1. 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 use specifically with each command. Script Editor displays an...
Scripting Guide
Page 20
... OK. 7. Choose View > Object Browser. 4. On the COM tab, find "Adobe Photoshop CS3 Object Library". Now the Photoshop CS3 Library is indicate that the commands be executed in Photoshop CS3. Note: In JavaScript, you do not need to target the Application object because you... to display more information about the class. 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...
... OK. 7. Choose View > Object Browser. 4. On the COM tab, find "Adobe Photoshop CS3 Object Library". Now the Photoshop CS3 Library is indicate that the commands be executed in Photoshop CS3. Note: In JavaScript, you do not need to target the Application object because you... to display more information about the class. 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...
Scripting Guide
Page 21
...'s collection name to name the object type. Creating New Objects in a Script To create a new document in the Photoshop CS3 application, you do the following example, the variable named docRef holds a reference to reference an Application object, all commands... name. In the following to target the application: Dim appRef Set appRef = CreateObject("Photoshop.Application") JS In JavaScript, because you select File > New. See Introduction to reference the Application object throughout the script. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 21 ...
...'s collection name to name the object type. Creating New Objects in a Script To create a new document in the Photoshop CS3 application, you do the following example, the variable named docRef holds a reference to reference an Application object, all commands... name. In the following to target the application: Dim appRef Set appRef = CreateObject("Photoshop.Application") JS In JavaScript, because you select File > New. See Introduction to reference the Application object throughout the script. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 21 ...
Scripting Guide
Page 22
...in a VBScript script, you cannot use the Add method only with an object, look up in the Document object in the Adobe Photoshop CS3 Visual Basic Scripting Reference or in VBScript, you add a VBScript or JavaScript object to an element the same way you must... or referring to say, the first document created has index 1, rather than a document, you will contain the art layer. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 22 set statement. the ArtLayers object does. For more information, look up the make new document in your script. That is...
...in a VBScript script, you cannot use the Add method only with an object, look up in the Document object in the Adobe Photoshop CS3 Visual Basic Scripting Reference or in VBScript, you add a VBScript or JavaScript object to an element the same way you must... or referring to say, the first document created has index 1, rather than a document, you will contain the art layer. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 22 set statement. the ArtLayers object does. For more information, look up the make new document in your script. That is...