Adobe 23102480 Scripting Guide - Page 31

Allowing or Preventing Dialogs, Working with the Photoshop CS3 Object Model

Page 31 highlights

Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 31 preferences.typeUnits = TypeUnits.PIXELS In the Adobe Photoshop CS3 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 CS3 action. AS The following script prevents dialogs from being displayed: set display dialogs to never In the Adobe Photoshop CS3 AppleScript Scripting Reference or in the Photoshop CS3 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 CS3 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 CS3 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 CS3 Object Model This section contains information about using the objects in the Photoshop CS3 Object Model. For information on object models, see Introduction to Scripting and 'Photoshop CS3 Object Model' on page 9. Using the Application Object This section describes how and when to use the Application object in a script. It also describes how to use some properties of the Application object.

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85

Photoshop CS3
Adobe Photoshop CS3
Scripting Guide
Scripting Photoshop CS3
31
preferences.typeUnits = TypeUnits.PIXELS
In the
Adobe Photoshop CS3 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 CS3 action.
AS
The following script prevents dialogs from being displayed:
set display dialogs to never
In the
Adobe Photoshop CS3 AppleScript Scripting Reference
or in the Photoshop CS3 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 CS3 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 CS3 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 CS3 Object Model
This section contains information about using the objects in the Photoshop CS3 Object Model. For
information on object models, see
Introduction to Scripting
and
‘Photoshop CS3 Object Model’ on page 9
.
Using the Application Object
This section describes how and when to use the
Application
object in a script. It also describes how to
use some properties of the
Application
object.