Adobe 65014293 Scripting Guide - Page 18
Creating and running an AppleScript, Introduction to Scripting
UPC - 883919153544
View all Adobe 65014293 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 18 highlights
CHAPTER 2: Photoshop Scripting Basics Creating a sample Hello World script 18 Creating and running an AppleScript You must open the Apple® Script Editor application in order to complete this procedure. NOTE: The default location for the Script Editor is Applications > AppleScript > Script Editor. To create and run your first Photoshop AppleScript: 1. Enter the following script in the Script Editor: NOTE: The lines preceded by "--" are comments. Entering the comments is optional. -- Sample script to create a new text item and -- change its contents. --target Photoshop CS4 tell application "Adobe Photoshop CS4" -- Create a new document and art layer. set docRef to make new document with properties ¬ {width:4 as inches, height:2 as inches} set artLayerRef to make new art layer in docRef -- Change the art layer to be a text layer. set kind of artLayerRef to text layer -- Get a reference to the text object and set its contents. set contents of text object of artLayerRef to "Hello, World" end tell 2. Click Run to run the script. Photoshop creates a new document, adds a new layer, changes the layer's type to text and sets the text to "Hello, World" NOTE: If you encounter errors, refer to Introduction to Scripting, which has a section on AppleScript debugging.