Adobe 65048599 Scripting Guide - Page 33
Allowing or Preventing Dialogs, Working with the Photoshop Object Model
View all Adobe 65048599 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 33 highlights
CHAPTER 3: Scripting Photoshop Allowing or Preventing Dialogs 33 JS The Preferences object is a property of the Application object. preferences.rulerUnits = Units.INCHES preferences.typeUnits = TypeUnits.PIXELS In the Adobe Photoshop CS5 JavaScript Scripting Reference, or in the ExtendScript Object Model Viewer, 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. Allowing or Preventing Dialogs It is important to be able to control dialogs properly from a script. If a dialog appears, your script stops until a user dismisses the dialog. This is normally fine in an interactive script that expects a user to be sitting at the machine. But if you have a script that runs in an unsupervised (batch) mode, you do not want dialogs to be displayed and stop your script. You use the display dialogs (DisplayDialogs/displayDialogs) property of the Application object to control whether or not dialogs are displayed. NOTE: Using dialogs in your script is roughly equivalent to using stops in a Photoshop action. AS The following script prevents dialogs from being displayed: set display dialogs to never In the Adobe Photoshop CS5 AppleScript Scripting Reference or in the Photoshop AppleScript Dictionary, look up the Class application to find the values you can use for the display dialogs property. VBS To set dialog preferences, you use the DisplayDialogs property of the Application object. appRef.DisplayDialogs = 3 'for PsDialogModes --> 3 (psDisplayNoDialogs) Note that, because DisplayDialogs is a property of the Application object, you must reference the Application object in the script to get to the property. In the Adobe Photoshop CS5 Visual Basic Scripting Reference, or in the Visual Basic Object Browser, look up the Application object property DisplayDialogs. You'll see the value type for this property is the constant PsDialogModes. You can also look up the options for PsDialogModes. JS To set dialog preferences, you use the displayDialogs property of the Application object. displayDialogs = DialogModes.NO In the Adobe Photoshop CS5 JavaScript Scripting Reference, or in the ExtendScript Object Model Viewer, look up the Application object property displayDialogs, and then look up the constant DialogModes. Working with the Photoshop Object Model This section contains information about using the objects in the Photoshop Object Model. For information on object models, see Introduction to Scripting and "Photoshop Object Model" on page 11.