Scripting Guide
Page 2
...of Microsoft Corporation in the United States and other countries. Adobe Systems Inc., 345 Park Avenue, San Jose, California 95110, USA. Adobe® Creative Suite® 4 Photoshop® Scripting Guide Adobe, the Adobe logo, Illustrator, and Photoshop are the property of such license. The software described in... no responsibility or liability for informational use only, is furnished under license and may only be construed as a commitment by Adobe Systems Inc. JavaScript and all Java-related marks are trademarks of Sun Microsystems, Inc. The information in this document is ...
...of Microsoft Corporation in the United States and other countries. Adobe Systems Inc., 345 Park Avenue, San Jose, California 95110, USA. Adobe® Creative Suite® 4 Photoshop® Scripting Guide Adobe, the Adobe logo, Illustrator, and Photoshop are the property of such license. The software described in... no responsibility or liability for informational use only, is furnished under license and may only be construed as a commitment by Adobe Systems Inc. JavaScript and all Java-related marks are trademarks of Sun Microsystems, Inc. The information in this document is ...
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
...these languages through the object browsers available for that is part of scripting, how to scripting Adobe® Photoshop® CS4 on page 22. Chapter 3 covers Photoshop-specific objects and components and describes advanced techniques for late-breaking news, sample scripts, and ...Tools Guide. For information about outstanding issues. 1 Introduction About this Manual This manual provides an introduction to execute scripts, and the Photoshop object model. Chapter 2 covers a brief overview of the Application object." 6 Chapter 4 covers the Action Manager, which allows you...
...these languages through the object browsers available for that is part of scripting, how to scripting Adobe® Photoshop® CS4 on page 22. Chapter 3 covers Photoshop-specific objects and components and describes advanced techniques for late-breaking news, sample scripts, and ...Tools Guide. For information about outstanding issues. 1 Introduction About this Manual This manual provides an introduction to execute scripts, and the Photoshop object model. Chapter 2 covers a brief overview of the Application object." 6 Chapter 4 covers the Action Manager, which allows you...
Scripting Guide
Page 8
... filters to Scripting guide. ➤ For examples of scripts created specifically for Photoshop Actions. If you to add functionality that decides which color border to skip much of this installation: Adobe Photoshop CS4 AppleScript Scripting Reference, Adobe Photoshop CS4 Visual Basic Scripting Reference, and Adobe Photoshop CS4 JavaScript Scripting Reference. If you've used by allowing you are familiar with...
... filters to Scripting guide. ➤ For examples of scripts created specifically for Photoshop Actions. If you to add functionality that decides which color border to skip much of this installation: Adobe Photoshop CS4 AppleScript Scripting Reference, Adobe Photoshop CS4 Visual Basic Scripting Reference, and Adobe Photoshop CS4 JavaScript Scripting Reference. If you've used by allowing you are familiar with...
Scripting Guide
Page 9
... file location. For Windows, using these languages with Adobe applications, see Introduction to another Adobe Creative Suite 4 Application, such as a valid script file, it cannot launch Photoshop. NOTE: See Photoshop Help for more versatility for file paths. However, if the script is launched by Photoshop as Adobe Illustrator® CS4, in the same script. ➤ You can...
... file location. For Windows, using these languages with Adobe applications, see Introduction to another Adobe Creative Suite 4 Application, such as a valid script file, it cannot launch Photoshop. NOTE: See Photoshop Help for more versatility for file paths. However, if the script is launched by Photoshop as Adobe Illustrator® CS4, in the same script. ➤ You can...
Scripting Guide
Page 10
...Scripts folder. By putting a JavaScript file into the appropriate location on disk, it can be accessed directly from the Adobe Photoshop Scripts menu (File > Scripts), which allows you select a script file, it must include code such as an installed...Photoshop is : C:\Program Files\Common Files\Adobe\Startup Scripts CS4\Adobe Photoshop ➤ On Mac OS, the startup folder for execution. Executing other Adobe Creative Suite 3 applications at the end of JavaScript's platform-independence by Photoshop, it is : ~/Library/Application Support/Adobe/Startup Scripts CS4/Adobe Photoshop...
...Scripts folder. By putting a JavaScript file into the appropriate location on disk, it can be accessed directly from the Adobe Photoshop Scripts menu (File > Scripts), which allows you select a script file, it must include code such as an installed...Photoshop is : C:\Program Files\Common Files\Adobe\Startup Scripts CS4\Adobe Photoshop ➤ On Mac OS, the startup folder for execution. Executing other Adobe Creative Suite 3 applications at the end of JavaScript's platform-independence by Photoshop, it is : ~/Library/Application Support/Adobe/Startup Scripts CS4/Adobe Photoshop...
Scripting Guide
Page 11
... of the hierarchy. For additional information about Adobe object models and the scripting languages that contain them , see Introduction to the Photoshop application and its components. Most of the functionality available through the Photoshop user interface is an application programming interface (...See Introduction to an existing document, or change individual object properties like color, size and shape. CHAPTER 2: Photoshop Scripting Basics Photoshop Object Model 11 Photoshop Object Model A document object model (DOM) is available through the DOM. For example, through the DOM, ...
... of the hierarchy. For additional information about Adobe object models and the scripting languages that contain them , see Introduction to the Photoshop application and its components. Most of the functionality available through the Photoshop user interface is an application programming interface (...See Introduction to an existing document, or change individual object properties like color, size and shape. CHAPTER 2: Photoshop Scripting Basics Photoshop Object Model 11 Photoshop Object Model A document object model (DOM) is available through the DOM. For example, through the DOM, ...
Scripting Guide
Page 12
...Item Text Item (Object) Path Point Layer Set Art Layer Application and document classes The Application class is implemented as a property of the Photoshop object model hierarchy. Scripts must target the appropriate application in a Script" on page 23 and "Using the Document object" on page 41...layers: an Art Layer that can contain image contents and a Layer Set that allows you to add type to run correctly. CHAPTER 2: Photoshop Scripting Basics . For more information on page 22. Images are typically composed of art layer that comprise it. See "Targeting and Referencing...
...Item Text Item (Object) Path Point Layer Set Art Layer Application and document classes The Application class is implemented as a property of the Photoshop object model hierarchy. Scripts must target the appropriate application in a Script" on page 23 and "Using the Document object" on page 41...layers: an Art Layer that can contain image contents and a Layer Set that allows you to add type to run correctly. CHAPTER 2: Photoshop Scripting Basics . For more information on page 22. Images are typically composed of art layer that comprise it. See "Targeting and Referencing...
Scripting Guide
Page 13
... has four default channels: one for editing the entire image. In addition to the component channels, Photoshop lets you create a document and then immediately try to get history state, Photoshop returns an error. History State class The History State class is any data that keeps track of that...before you could choose to manipulate all the channels at once. NOTE: In AppleScript, if you to create additional channels. You must first activate Photoshop-make it as a folder on page 47. Metadata is a palette object that helps to describe the content or characteristics of a file. ...
... has four default channels: one for editing the entire image. In addition to the component channels, Photoshop lets you create a document and then immediately try to get history state, Photoshop returns an error. History State class The History State class is any data that keeps track of that...before you could choose to manipulate all the channels at once. NOTE: In AppleScript, if you to create additional channels. You must first activate Photoshop-make it as a folder on page 47. Metadata is a palette object that helps to describe the content or characteristics of a file. ...
Scripting Guide
Page 14
..."Using Notifier objects" on page 61. Count Item class The Count Item object provides scripting support for the Color Sampler Tool. Start the Photoshop application. Choose the marquee or lasso tools and drag your document. The Sub Path Item class is contained in a sub path. Notifier... allows you create layers, channels, actions, and so on page 49. Object name Description To create this object without using a script Application The Photoshop application. In a script, you could tie a script that allows you would a file in which you to access and set a scale for ...
..."Using Notifier objects" on page 61. Count Item class The Count Item object provides scripting support for the Color Sampler Tool. Start the Photoshop application. Choose the marquee or lasso tools and drag your document. The Sub Path Item class is contained in a sub path. Notifier... allows you create layers, channels, actions, and so on page 49. Object name Description To create this object without using a script Application The Photoshop application. In a script, you could tie a script that allows you would a file in which you to access and set a scale for ...
Scripting Guide
Page 15
... describe the content or characteristics of a file, such filename, creation date and time, author name, the name of Photoshop. Preferences The application preference settings. Measurement Represents the measurement scale for your document. Document Info Metadata about an image's color... File > Scripts > Script Events Manager. Choose the Color Sampler Tool, and click in a document. CHAPTER 2: Photoshop Scripting Basics Photoshop Object Model 15 Object name Description To create this object without affecting other elements in the image. Notifier Notifies a script...
... describe the content or characteristics of a file, such filename, creation date and time, author name, the name of Photoshop. Preferences The application preference settings. Measurement Represents the measurement scale for your document. Document Info Metadata about an image's color... File > Scripts > Script Events Manager. Choose the Color Sampler Tool, and click in a document. CHAPTER 2: Photoshop Scripting Basics Photoshop Object Model 15 Object name Description To create this object without affecting other elements in the image. Notifier Notifies a script...
Scripting Guide
Page 16
...values for the Art Layer object's kind property. 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 CS4 Visual Basic Scripting Reference. Constants An additional important component of ... and "Saving a Document" on page 51. ➤ Open and save documents; Most of value that Photoshop allows. For example, look up the art ArtLayer object in either the Adobe Photoshop CS4 JavaScript Scripting Reference or in the containment hierarchy above.
...values for the Art Layer object's kind property. 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 CS4 Visual Basic Scripting Reference. Constants An additional important component of ... and "Saving a Document" on page 51. ➤ Open and save documents; Most of value that Photoshop allows. For example, look up the art ArtLayer object in either the Adobe Photoshop CS4 JavaScript Scripting Reference or in the containment hierarchy above.
Scripting Guide
Page 17
...inches wide and 2 inches high. 3. When we create the document, we will use comments to the document as illustrated below. Open the Photoshop application. 2. In our script, we will also create a variable named docRef and then assign a reference to excess. Define artLayerRef as the ...value of docRef. In fact, because this is the display of the three scripting languages for Photoshop. These steps mirror a specific path in any programming environment is our first script, we will also include comments throughout the scripts. ...
...inches wide and 2 inches high. 3. When we create the document, we will use comments to the document as illustrated below. Open the Photoshop application. 2. In our script, we will also create a variable named docRef and then assign a reference to excess. Define artLayerRef as the ...value of docRef. In fact, because this is the display of the three scripting languages for Photoshop. These steps mirror a specific path in any programming environment is our first script, we will also include comments throughout the scripts. ...
Scripting Guide
Page 18
...: If you encounter errors, refer to Introduction to "Hello, World" end tell 2. Entering the comments is Applications > AppleScript > Script Editor. set its contents. --target Photoshop CS4 tell application "Adobe Photoshop CS4" -- To create and run the script. change its contents. Click Run to the text object and set contents of text object of artLayerRef to...
...: If you encounter errors, refer to Introduction to "Hello, World" end tell 2. Entering the comments is Applications > AppleScript > Script Editor. set its contents. --target Photoshop CS4 tell application "Adobe Photoshop CS4" -- To create and run the script. change its contents. Click Run to the text object and set contents of text object of artLayerRef to...
Scripting Guide
Page 19
... following script into a script or text editor. The script opens Photoshop. NOTE: Adobe has created the Extend Script scripting language to augment JavaScript for more information. Dim appRef Set appRef = CreateObject( "Photoshop.Application" ) ' Remember current unit settings and then set units to...artLayerRef.Kind = 2 ' Set the contents of the JavaScript Tools Guide for use the Extend Script command #target to target the Photoshop application and create the ability to open JavaScripts that displays the text Hello World! Set textItemRef = artLayerRef.TextItem textItemRef.Contents = ...
... following script into a script or text editor. The script opens Photoshop. NOTE: Adobe has created the Extend Script scripting language to augment JavaScript for more information. Dim appRef Set appRef = CreateObject( "Photoshop.Application" ) ' Remember current unit settings and then set units to...artLayerRef.Kind = 2 ' Set the contents of the JavaScript Tools Guide for use the Extend Script command #target to target the Photoshop application and create the ability to open JavaScripts that displays the text Hello World! Set textItemRef = artLayerRef.TextItem textItemRef.Contents = ...
Scripting Guide
Page 20
...File > Scripts menu until you restart the application. NOTE: Photoshop also supports JavaScript files that use a .js extension. 3. CHAPTER 2: Photoshop Scripting Basics Creating a sample Hello World script 20 To create and run your Adobe Photoshop CS4 directory. NOTE: Entering comments is already open, choose File... > Scripts > Browse, and then navigate to the Presets > Scripts folder and choose your script. ➣ Start or restart Photoshop, and then choose File > Scripts...
...File > Scripts menu until you restart the application. NOTE: Photoshop also supports JavaScript files that use a .js extension. 3. CHAPTER 2: Photoshop Scripting Basics Creating a sample Hello World script 20 To create and run your Adobe Photoshop CS4 directory. NOTE: Entering comments is already open, choose File... > Scripts > Browse, and then navigate to the Presets > Scripts folder and choose your script. ➣ Start or restart Photoshop, and then choose File > Scripts...
Scripting Guide
Page 21
.... The dictionary also lists the parameters for each object. TIP: Throughout this installation: ➤ Adobe Photoshop CS4 AppleScript Scripting Reference ➤ Adobe Photoshop CS4 Visual Basic Scripting Reference ➤ Adobe Photoshop CS4 JavaScript Scripting Reference In addition, you quickly understand how to script Photoshop. Choose Adobe Photoshop CS4, and then click Open. Using these instructions will also learn how to use the reference...
.... The dictionary also lists the parameters for each object. TIP: Throughout this installation: ➤ Adobe Photoshop CS4 AppleScript Scripting Reference ➤ Adobe Photoshop CS4 Visual Basic Scripting Reference ➤ Adobe Photoshop CS4 JavaScript Scripting Reference In addition, you quickly understand how to script Photoshop. Choose Adobe Photoshop CS4, and then click Open. Using these instructions will also learn how to use the reference...
Scripting Guide
Page 22
... Visual Studio 2005, or Visual Basic. 2. Click OK. 7. Now the Photoshop Library is indicate that the commands be executed in Photoshop. Click on page 19.) Select View > Object Browser. 3. On the COM tab, find "Adobe Photoshop CS4 Object Library". Choose Photoshop CS4 type library from the Photoshop application itself. (See "Creating and running a JavaScript" on the plus sign...
... Visual Studio 2005, or Visual Basic. 2. Click OK. 7. Now the Photoshop Library is indicate that the commands be executed in Photoshop. Click on page 19.) Select View > Object Browser. 3. On the COM tab, find "Adobe Photoshop CS4 Object Library". Choose Photoshop CS4 type library from the Photoshop application itself. (See "Creating and running a JavaScript" on the plus sign...
Scripting Guide
Page 23
..., and Preferences objects. To reference the Application object, use the following to target the application: Dim appRef Set appRef = CreateObject("Photoshop.Application") JS In JavaScript, because you can reference the application as part of objects within a document, such as a layer, ...channel, or path, you select File > New. The following statements: tell application "Adobe Photoshop CS4" ... For example, you add a document to Scripting for you to the art layers collection. See Introduction to the Documents collection; This...
..., and Preferences objects. To reference the Application object, use the following to target the application: Dim appRef Set appRef = CreateObject("Photoshop.Application") JS In JavaScript, because you can reference the application as part of objects within a document, such as a layer, ...channel, or path, you select File > New. The following statements: tell application "Adobe Photoshop CS4" ... For example, you add a document to Scripting for you to the art layers collection. See Introduction to the Documents collection; This...