Setting Application Preferences; Allowing Or Preventing Dialogs - Adobe PHOTOSHOP CS 2.0 - SCRIPTING GUIDE Manual

Table of Contents

Advertisement

Adobe Photoshop CS2 Scripting Guide
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
Preferences dialog options, which you display by choosing Photoshop > Preferences on Mac OS or
Edit > Preferences in Windows versions of Photoshop CS2. For explanations of individual
preferences, please refer to Photoshop CS2 Help.
AS
You use properties of the
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 CS2 AppleScript Scripting Reference, look up
the settings properties you can use.
VBS
The
Preferences
in a VBScript script, you must indicate its containment in the
appRef.Preferences.RulerUnits = 2 'for PsUnits --> 2 (psInches)
appRef.Preferences.TypeUnits = 1 'for PsTypeUnits --> 1 (psPixels)
In the Adobe Photoshop CS2 Visual Basic Scripting Reference, look up the
the settings properties you can use. Additionally, look up the
property.
JS
The Preferences object is a property of the
preferences.rulerUnits =Units.INCHES
preferences.typeUnits = TypeUnits.PIXELS
In the Adobe Photoshop CS2 JavaScript Scripting Reference, look up the
the settings properties you can use. Additionally, look up the
property.

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
to control whether or not dialogs are displayed.
settings
class to set application preferences in AppleScript. The following script
settings
object is a property of the
(
display dialogs
DisplayDialogs/displayDialogs
Photoshop CS2
class/
object correlate to the Photoshop CS2
Preferences
object. When you use the
Application
Application
Application
object.
Application
Application
Scripting Photoshop CS2
Class settings-object
Preferences
object.
object to view all of
Preferences
object >
Preferences
object to view all of
Preferences
object >
preferences
) property of the
Application
46
to view all of
object
object

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Photoshop cs2

Table of Contents