Adobe 23102480 Scripting Guide - Page 30

Setting Application Preferences, Photoshop > Preferences, Edit > Preferences

Page 30 highlights

Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 30 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 JS 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 CS3 Preferences dialog options, which you display by choosing Photoshop > Preferences on Mac OS or Edit > Preferences in Windows versions of Photoshop CS3. For explanations of individual preferences, please refer to Photoshop CS3 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 CS3 AppleScript Scripting Reference, or in the Photoshop CS3 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 CS3 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. JS The Preferences object is a property of the Application object. preferences.rulerUnits = Units.INCHES

  • 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
30
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
JS
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 CS3
Preferences dialog options, which you display by choosing
Photoshop > Preferences
on Mac OS or
Edit > Preferences
in Windows versions of Photoshop CS3. For explanations of individual
preferences, please refer to Photoshop CS3 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 CS3 AppleScript Scripting Reference
, or in the Photoshop CS3 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 CS3 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.
JS
The Preferences object is a property of the
Application
object.
preferences.rulerUnits = Units.INCHES