Home / Articles / Adobe Photoshop / Learn How to Script Adobe Photoshop CS2

Learn How to Script Adobe Photoshop CS2

Chapter Description

This chapter demonstrates several techniques for creating scripts to use specifically with Adobe Photoshop CS2. More importantly, you'll learn how to use the Adobe Photoshop CS2 scripting references to find the objects, classes, properties, methods, and even some values (called constants or enumerations) you can use to create JavaScripts for Adobe Photoshop CS2.

Saving a document

Options for saving documents in Adobe Photoshop CS2 are illustrated below. To find out which properties you can specify for a specific file format save option, look up the object that begins with the file format name. For example, to find out about properties for saving an .eps file, look up EPSSaveOptions in Part 2 of this book.

The following script saves a document as a .jpeg file:

jpgFile = new File( "/Temp001.jpeg" )
jpgSaveOptions = new JPEGSaveOptions()
jpgSaveOptions.embedColorProfile = true
jpgSaveOptions.formatOptions =
FormatOptions.STANDARDBASELINE
jpgSaveOptions.matte = MatteType.NONE
jpgSaveOptions.quality = 1
app.activeDocument.saveAs(jpgFile, jpgSaveOptions, true,
   Extension.LOWERCASE)
6. Setting application preferences | Next Section Previous Section