Adobe 23101764 Scripting Guide - Page 18
Hello World Sample Scripts
UPC - 718659340025
View all Adobe 23101764 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 18 highlights
Scripting basics 2 Object Model 2.3.2 Hello World Sample Scripts When all is said and done, the Object Model is simply a means to an end -- writing Photoshop scripts that accomplish something useful using the classes provided. Traditionally, the first thing to accomplish in any programming environment is the display of a "Hello World" message. You can script such a message in Photoshop CS using AppleScript, Visual Basic or JavaScript. Regardless of the language employed, the basic steps involved are the same: • Open the Photoshop application • Create a new document object • Add an art layer to the document • Change the art layer to a text item • Set the contents of the text item These steps mirror a specific path in the containment hierarchy, as illustrated below. Application Document Art Layer Text Item The relationships exposed in the containment hierarchy are fully preserved in the scripting sequence. Understanding the Object Model is the key to writing effective scripts in Photoshop CS. To see how this plays out in practice, we include three sample scripts implementing "Hello World!". NOTE: For details on advanced scripting techniques for AppleScript, Visual Basic and JavaScript, see Chapter 3, "Scripting Photoshop. Photoshop CS Scripting Guide 14