Scripting Guide
Page 2
...trademarks or registered trademarks of Sun Microsystems, Inc. JavaScript and all Java-related marks are trademarks of their respective owners. Adobe Systems Inc. The software described in this document is subject to change without notice, and should not be used or...the United States and other countries. in accordance with the terms of Adobe Systems Inc. All rights reserved. Adobe® Creative Suite® 5 Photoshop® Scripting Guide Adobe, the Adobe logo, Illustrator, and Photoshop are either registered trademarks or trademarks of such license. Microsoft and ...
...trademarks or registered trademarks of Sun Microsystems, Inc. JavaScript and all Java-related marks are trademarks of their respective owners. Adobe Systems Inc. The software described in this document is subject to change without notice, and should not be used or...the United States and other countries. in accordance with the terms of Adobe Systems Inc. All rights reserved. Adobe® Creative Suite® 5 Photoshop® Scripting Guide Adobe, the Adobe logo, Illustrator, and Photoshop are either registered trademarks or trademarks of such license. Microsoft and ...
Scripting Guide
Page 3
...Notifier class 14 Count Item class 14 Color Sampler class 14 Measurement Scale class 14 The containment hierarchy and the Photoshop user interface 14 Additional objects 16 Constants 16 Creating a sample Hello World script 17 Creating and running an AppleScript... 18 Creating and running a VBScript 19 Creating and running a JavaScript 19 3 Scripting Photoshop 21 Viewing Photoshop Objects, Commands, and Methods 21 Viewing Photoshop's AppleScript dictionary 21 Viewing Photoshop's type library (VBS 22 Targeting and Referencing the Application Object 22 Creating New Objects ...
...Notifier class 14 Count Item class 14 Color Sampler class 14 Measurement Scale class 14 The containment hierarchy and the Photoshop user interface 14 Additional objects 16 Constants 16 Creating a sample Hello World script 17 Creating and running an AppleScript... 18 Creating and running a VBScript 19 Creating and running a JavaScript 19 3 Scripting Photoshop 21 Viewing Photoshop Objects, Commands, and Methods 21 Viewing Photoshop's AppleScript dictionary 21 Viewing Photoshop's type library (VBS 22 Targeting and Referencing the Application Object 22 Creating New Objects ...
Scripting Guide
Page 4
... default file format 28 Specifying file formats to open 29 Saving a Document 31 Setting Application Preferences 32 Allowing or Preventing Dialogs 33 Working with the Photoshop Object Model 33 Using the Application object 34 Using the Document object 34 Manipulating a document object 35 Working with layer objects 36 Creating an ArtLayer...
... default file format 28 Specifying file formats to open 29 Saving a Document 31 Setting Application Preferences 32 Allowing or Preventing Dialogs 33 Working with the Photoshop Object Model 33 Using the Application object 34 Using the Document object 34 Manipulating a document object 35 Working with layer objects 36 Creating an ArtLayer...
Scripting Guide
Page 6
... reference information is part of these languages through the Scripting Reference Manuals provided with Photoshop for scripting the Photoshop application. 1 Introduction About this Manual This manual provides an introduction to scripting Adobe® Photoshop® CS5 on page 22. Chapter 1 covers the basic conventions used to refer both to AppleScript, VBScript and JavaScript. See...
... reference information is part of these languages through the Scripting Reference Manuals provided with Photoshop for scripting the Photoshop application. 1 Introduction About this Manual This manual provides an introduction to scripting Adobe® Photoshop® CS5 on page 22. Chapter 1 covers the basic conventions used to refer both to AppleScript, VBScript and JavaScript. See...
Scripting Guide
Page 8
... you could write a script to generate a number of localized versions of a particular image or to skip much of this installation: Adobe Photoshop CS5 AppleScript Scripting Reference, Adobe Photoshop CS5 Visual Basic Scripting Reference, and Adobe Photoshop CS5 JavaScript Scripting Reference. Scripts automate repetitive tasks and are new to scripting, you 're already familiar with the basic...
... you could write a script to generate a number of localized versions of a particular image or to skip much of this installation: Adobe Photoshop CS5 AppleScript Scripting Reference, Adobe Photoshop CS5 Visual Basic Scripting Reference, and Adobe Photoshop CS5 JavaScript Scripting Reference. Scripts automate repetitive tasks and are new to scripting, you 're already familiar with the basic...
Scripting Guide
Page 9
... OS® Mac OS & Windows Windows Windows For a JavaScript file to another Adobe Creative Suite 5 Application, such as Adobe Illustrator® CS5, in the way scripts with the ExtendScript engine. See "Executing JavaScripts from one computer to be recognized by Photoshop as a valid script file it must use , and for more versatility for...
... OS® Mac OS & Windows Windows Windows For a JavaScript file to another Adobe Creative Suite 5 Application, such as Adobe Illustrator® CS5, in the way scripts with the ExtendScript engine. See "Executing JavaScripts from one computer to be recognized by Photoshop as a valid script file it must use , and for more versatility for...
Scripting Guide
Page 10
... script. You can also use Browse to select a script file for user-defined scripts is: ~/Library/Application Support/Adobe/Startup Scripts CS5/Adobe Photoshop If your JavaScripts. Executing JavaScripts from AS or VBS You can take advantage of the scripts in the Scripts folder,... the application. Any number of sub-folders does not add a hierarchical organization to the Scripts folder while Photoshop is : C:\Program Files\Common Files\Adobe\Startup Scripts CS5\Adobe Photoshop ➤ On Mac OS, the startup folder for execution. All scripts found in the Scripts folder after...
... script. You can also use Browse to select a script file for user-defined scripts is: ~/Library/Application Support/Adobe/Startup Scripts CS5/Adobe Photoshop If your JavaScripts. Executing JavaScripts from AS or VBS You can take advantage of the scripts in the Scripts folder,... the application. Any number of sub-folders does not add a hierarchical organization to the Scripts folder while Photoshop is : C:\Program Files\Common Files\Adobe\Startup Scripts CS5\Adobe Photoshop ➤ On Mac OS, the startup folder for execution. All scripts found in the Scripts folder after...
Scripting Guide
Page 11
For additional information about Adobe object models and the scripting languages that objects in the Photoshop DOM. Applications contain a Documents collection. NOTE: In Photoshop, VBScript collections index from 0. Containment hierarchy The Photoshop object model is a containment hierarchy, which means that... Introduction to Scripting. Not all classes are identified partially by elements or collection. The following elements/collections exist in Photoshop: Art Layers, Channels, Color Samplers, Count Items, Documents, Layers, Layer Comps, Layer Sets, History States, ...
For additional information about Adobe object models and the scripting languages that objects in the Photoshop DOM. Applications contain a Documents collection. NOTE: In Photoshop, VBScript collections index from 0. Containment hierarchy The Photoshop object model is a containment hierarchy, which means that... Introduction to Scripting. Not all classes are identified partially by elements or collection. The following elements/collections exist in Photoshop: Art Layers, Channels, Color Samplers, Count Items, Documents, Layers, Layer Comps, Layer Sets, History States, ...
Scripting Guide
Page 12
The Document class is the root of the art layer. An Art Layer is a layer class within the active document or between different documents. In Photoshop, a Text Item item is a particular type of an image without disturbing the others. See "Targeting and Referencing the Application Object" on one ... save the current document, and copy and paste within a document that allows you to add type to work on page 22. Layer classes Photoshop has two types of layers: an Art Layer that can contain zero or more information on using the Document object you to an image. ...
The Document class is the root of the art layer. An Art Layer is a layer class within the active document or between different documents. In Photoshop, a Text Item item is a particular type of an image without disturbing the others. See "Targeting and Referencing the Application Object" on one ... save the current document, and copy and paste within a document that allows you to add type to work on page 22. Layer classes Photoshop has two types of layers: an Art Layer that can contain zero or more information on using the Document object you to an image. ...
Scripting Guide
Page 13
... of the active document) that keeps track of channels are related to work with Channel objects" on page 46. You must first activate Photoshop-make it as a folder on document info, see "Working with . For more information on your desktop. Since folders can also be...of a Channel object, you can be used to manipulate all the channels at once. These states are called component channels. CHAPTER 2: Photoshop Scripting Basics Photoshop Object Model 13 A Layer Set is recursive. Using the commands or methods of it the front-most application-before you can create a...
... of the active document) that keeps track of channels are related to work with Channel objects" on page 46. You must first activate Photoshop-make it as a folder on document info, see "Working with . For more information on your desktop. Since folders can also be...of a Channel object, you can be used to manipulate all the channels at once. These states are called component channels. CHAPTER 2: Photoshop Scripting Basics Photoshop Object Model 13 A Layer Set is recursive. Using the commands or methods of it the front-most application-before you can create a...
Scripting Guide
Page 14
...support for your mouse. Selection The selected area of the shape. The Path Point class contains information about a drawing object, such as you would like Photoshop to automatically create a new document when you open , or save a document as the outline of a shape, or a curved line. In a script...you would a file in the Path Item class, and provides the actual geometry of a layer or document. The containment hierarchy and the Photoshop user interface The following table provides describes how each point in which you to access and set a scale for the new Measurement Scale ...
...support for your mouse. Selection The selected area of the shape. The Path Point class contains information about a drawing object, such as you would like Photoshop to automatically create a new document when you open , or save a document as the outline of a shape, or a curved line. In a script...you would a file in the Path Item class, and provides the actual geometry of a layer or document. The containment hierarchy and the Photoshop user interface The following table provides describes how each point in which you to access and set a scale for the new Measurement Scale ...
Scripting Guide
Page 15
... Scale > Custom. Choose Window > Layer Comp. NOTE: Metadata is the current name in the Photoshop UI. Choose File > Scripts > Script Events Manager. History State Stores a version of Photoshop. Color Sampler Represents a color sampler in each time you to describe the content or characteristics of... user clicks an OK button, the notifier object tells the script what to keep backward compatibility. Choose Edit > Preferences in Windows, or Photoshop > Preferences in the document. Choose Layer > New > Group. Choose the Count Tool and click in Mac OS. Art Layer A layer...
... Scale > Custom. Choose Window > Layer Comp. NOTE: Metadata is the current name in the Photoshop UI. Choose File > Scripts > Script Events Manager. History State Stores a version of Photoshop. Color Sampler Represents a color sampler in each time you to describe the content or characteristics of... user clicks an OK button, the notifier object tells the script what to keep backward compatibility. Choose Edit > Preferences in Windows, or Photoshop > Preferences in the document. Choose Layer > New > Group. Choose the Count Tool and click in Mac OS. Art Layer A layer...
Scripting Guide
Page 16
... are used as arguments) for properties or to the right of an Art Layer object, you can use to the commands that Photoshop allows. For general information about using the following format: newLayerRef.Kind = 2 '2 indicates psLayerKind --> 2 (psTextLayer) The ' ... in either the Adobe Photoshop CS5 JavaScript Scripting Reference or in the containment hierarchy above. CHAPTER 2: Photoshop Scripting Basics Photoshop Object Model 16 Additional objects The Photoshop object model includes additional objects beyond the ones described in the Adobe Photoshop CS5 Visual Basic Scripting...
... are used as arguments) for properties or to the right of an Art Layer object, you can use to the commands that Photoshop allows. For general information about using the following format: newLayerRef.Kind = 2 '2 indicates psLayerKind --> 2 (psTextLayer) The ' ... in either the Adobe Photoshop CS5 JavaScript Scripting Reference or in the containment hierarchy above. CHAPTER 2: Photoshop Scripting Basics Photoshop Object Model 16 Additional objects The Photoshop object model includes additional objects beyond the ones described in the Adobe Photoshop CS5 Visual Basic Scripting...
Scripting Guide
Page 17
CHAPTER 2: Photoshop Scripting Basics Creating a sample Hello World script 17 Creating a sample Hello World script This section demonstrates a very... We will do the following: 1. Create a new Document object. In fact, because this is the display of the three scripting languages for Photoshop. These steps mirror a specific path in each of a "Hello World" message. Define artLayerRef as the value of docRef. In our script,...inches high. 3. Create an Art Layer object. Traditionally, the first thing to the document as a text item. 5. Open the Photoshop application. 2.
CHAPTER 2: Photoshop Scripting Basics Creating a sample Hello World script 17 Creating a sample Hello World script This section demonstrates a very... We will do the following: 1. Create a new Document object. In fact, because this is the display of the three scripting languages for Photoshop. These steps mirror a specific path in each of a "Hello World" message. Define artLayerRef as the value of docRef. In our script,...inches high. 3. Create an Art Layer object. Traditionally, the first thing to the document as a text item. 5. Open the Photoshop application. 2.
Scripting Guide
Page 18
...text object and set contents of text object of artLayerRef to "Hello, World" end tell 2. set its contents. --target Photoshop CS5 tell application "Adobe Photoshop CS5" -- Photoshop creates a new document, adds a new layer, changes the layer's type to text and sets the text to "Hello,...on AppleScript debugging. Create a new document and art layer. Enter the following script in docRef -- set artLayerRef to run your first Photoshop AppleScript: 1. Entering the comments is Applications > AppleScript > Script Editor. To create and run the script. change its contents. NOTE...
...text object and set contents of text object of artLayerRef to "Hello, World" end tell 2. set its contents. --target Photoshop CS5 tell application "Adobe Photoshop CS5" -- Photoshop creates a new document, adds a new layer, changes the layer's type to text and sets the text to "Hello,...on AppleScript debugging. Create a new document and art layer. Enter the following script in docRef -- set artLayerRef to run your first Photoshop AppleScript: 1. Entering the comments is Applications > AppleScript > Script Editor. To create and run the script. change its contents. NOTE...
Scripting Guide
Page 19
...script or text editor. Creating and running a VBScript Follow these steps to create and run a JavaScript that opens Photoshop at the beginning of the script. in a Photoshop document. NOTE: Entering comments is not necessary to include code that displays the text Hello World! Save file ... World script 19 Creating and running a JavaScript Follow these steps to create and run a VBScript that manipulate Photoshop from anywhere in your file system. NOTE: Adobe has created the Extend Script scripting language to open JavaScripts that displays the text Hello World! Set textItemRef =...
...script or text editor. Creating and running a VBScript Follow these steps to create and run a JavaScript that opens Photoshop at the beginning of the script. in a Photoshop document. NOTE: Entering comments is not necessary to include code that displays the text Hello World! Save file ... World script 19 Creating and running a JavaScript Follow these steps to create and run a VBScript that manipulate Photoshop from anywhere in your file system. NOTE: Adobe has created the Extend Script scripting language to open JavaScripts that displays the text Hello World! Set textItemRef =...
Scripting Guide
Page 20
... file with a .jsx file name extension in the Presets/Scripts folder in your JavaScripts in the Presets/Scripts folder in Photoshop. NOTE: You must place your Adobe Photoshop CS5 directory. The scripts do not appear on the File > Scripts menu until you restart the application. Type the following... : ➣ If Photoshop is optional. // Hello Word Script // Remember current unit settings and then set units to // the ...
... file with a .jsx file name extension in the Presets/Scripts folder in your JavaScripts in the Presets/Scripts folder in Photoshop. NOTE: You must place your Adobe Photoshop CS5 directory. The scripts do not appear on the File > Scripts menu until you restart the application. Type the following... : ➣ If Photoshop is optional. // Hello Word Script // Remember current unit settings and then set units to // the ...
Scripting Guide
Page 21
...10148; For JavaScript, use the ExtendScript Object Model Viewer. TIP: Throughout this installation: ➤ Adobe Photoshop CS5 AppleScript Scripting Reference ➤ Adobe Photoshop CS5 Visual Basic Scripting Reference ➤ Adobe Photoshop CS5 JavaScript Scripting Reference In addition, you can use to create AppleScripts, VBScript scripts, and JavaScripts... for Photoshop. Choose Adobe Photoshop CS5, and then click Open. You will help you can also access reference material by ...
...10148; For JavaScript, use the ExtendScript Object Model Viewer. TIP: Throughout this installation: ➤ Adobe Photoshop CS5 AppleScript Scripting Reference ➤ Adobe Photoshop CS5 Visual Basic Scripting Reference ➤ Adobe Photoshop CS5 JavaScript Scripting Reference In addition, you can use to create AppleScripts, VBScript scripts, and JavaScripts... for Photoshop. Choose Adobe Photoshop CS5, and then click Open. You will help you can also access reference material by ...
Scripting Guide
Page 22
...JavaScript, you do is loaded into the object browser. On the COM tab, find "Adobe Photoshop CS5 Object Library". Click Add. Now the Photoshop Library is indicate that the commands be executed in Photoshop. Choose an object class to target the Application object because you run your script should.... 5. Click on the plus sign next to display more information abut the class. Choose Tools > References, and then select the Adobe Photoshop Type Library check box and click OK. 3. Click on the plus sign next to display the objects and commands available for VBScript in...
...JavaScript, you do is loaded into the object browser. On the COM tab, find "Adobe Photoshop CS5 Object Library". Click Add. Now the Photoshop Library is indicate that the commands be executed in Photoshop. Choose an object class to target the Application object because you run your script should.... 5. Click on the plus sign next to display more information abut the class. Choose Tools > References, and then select the Adobe Photoshop Type Library check box and click OK. 3. Click on the plus sign next to display the objects and commands available for VBScript in...
Scripting Guide
Page 23
... hierarchy or leave it out, whichever makes your scripts easier for more information on elements and collections. You can see in the "Photoshop Object Model" on page 11, the Document object contains all other objects except the Application, Notifier, and Preferences objects. For example,...you add a document to name the object type. See Introduction to Scripting for you to create and then use the following statements: tell application "Adobe Photoshop CS5" ... Therefore, you must enclosing your script in the following command: ➤ AS: make ➤ VBS: Add ➤ JS: ...
... hierarchy or leave it out, whichever makes your scripts easier for more information on elements and collections. You can see in the "Photoshop Object Model" on page 11, the Document object contains all other objects except the Application, Notifier, and Preferences objects. For example,...you add a document to name the object type. See Introduction to Scripting for you to create and then use the following statements: tell application "Adobe Photoshop CS5" ... Therefore, you must enclosing your script in the following command: ➤ AS: make ➤ VBS: Add ➤ JS: ...