Adobe 65014293 Scripting Guide - Page 32
Setting Application Preferences
UPC - 883919153544
View all Adobe 65014293 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 32 highlights
CHAPTER 3: Scripting Photoshop Setting Application Preferences 32 VBS JS Dim appRef,docRef Set appRef = CreateObject("Photoshop.Application") Set docRef = appRef.Documents.Add() Set jpgSaveOptions = CreateObject("Photoshop.JPEGSaveOptions") jpgSaveOptions.EmbedColorProfile = True jpgSaveOptions.FormatOptions = 1 'for psStandardBaseline jpgSaveOptions.Matte = 1 'for psNoMatte jpgSaveOptions.Quality = 1 appRef.ActiveDocument.SaveAs "c:\temp\myFile2", _ jpgSaveOptions, True, 2 'for psLowercase app.documents.add( 4, 4 ) 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) Setting Application Preferences Your script can set application preferences such as color picker, file saving options, guide-grid-slice settings, and so on. NOTE: The properties in the settings class/Preferences object correlate to the Photoshop CS4 Preferences dialog options, which you display by choosing Photoshop > Preferences on Mac OS or Edit > Preferences in Windows versions of Photoshop. For explanations of individual preferences, please refer to Photoshop Help. AS You use properties of the settings class to set application preferences in AppleScript. The following script sets ruler and type unit settings: set ruler units of settings to inch units set type units of settings to pixel units In the Adobe Photoshop CS4 AppleScript Scripting Reference, or in the Photoshop AppleScript Dictionary, look up class settings-object to view all of the settings properties you can use. VBS The Preferences object is a property of the Application object. When you use the Preferences object in a VBScript script, you must indicate its containment in the Application object. appRef.Preferences.RulerUnits = 2 'for PsUnits --> 2 (psInches) appRef.Preferences.TypeUnits = 1 'for PsTypeUnits --> 1 (psPixels) In the Adobe Photoshop CS4 Visual Basic Scripting Reference, or in the Visual Basic Object Browser, look up the Preferences object to view all of the settings properties you can use. Additionally, look up the Preferences property on the Application object.