Adobe 23101335 Scripting Guide - Page 46

Unit value useage, set pixelValue to pixels 72

Page 46 highlights

Scripting Photoshop 3 Working with units Special unit value types The unit values used by Photoshop Scripting Support are length units, representing values of linear measurement. Support is also included for pixel and percent unit values. These two unit value types are not, strictly speaking, length values but are included because they are used extensively by Photoshop for many operations and values. NOTE: In AppleScript you can get and set values as pixels or percent as you would any other unit value type. You cannot, however, convert a pixel or percent value to another length unit value as you can with other length value types. Trying to run the following script will result in an error. set pixelValue to pixels 72 -- Next line will result in a coercion error when run set inchValue to pixelValue as inches 3.5.2 Unit value useage The following two tables list the properties of the classes and parameters of commands that are defined to use unit values. Unit values for these properties and parameter, with the exception of some text item properties, are based the graphics ruler setting. TABLE 3.2 Object Properties Object AppleScript Properties Visual Basic Properties JavaScript Properties Document height width Height Width height width EPS open options height width Height Width height width PDF open options lens flare open options height width height width Height Width Height Width height width height width offset filter horizontal offset vertical offset HorizontalOffset VerticalOffset horizontalOffset verticalOffset Photoshop 7.0 Scripting Guide 46

  • 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
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91

Photoshop 7.0 Scripting Guide
46
Scripting Photoshop
Working with units
3
Special unit value types
The unit values used by Photoshop Scripting Support are length units, representing values of
linear measurement. Support is also included for pixel and percent unit values. These two unit
value types are not, strictly speaking, length values but are included because they are used
extensively by Photoshop for many operations and values.
N
OTE
:
In AppleScript you can get and set values as pixels or percent as you would any other
unit value type. You cannot, however, convert a pixel or percent value to another length
unit value as you can with other length value types. Trying to run the following script
will result in an error.
set pixelValue to pixels 72
-- Next line will result in a coercion error when run
set inchValue to pixelValue as inches
3.5.2 Unit value useage
The following two tables list the properties of the classes and parameters of commands that are
defined to use unit values. Unit values for these properties and parameter, with the exception
of some text item properties, are based the graphics ruler setting.
T
ABLE
3.2
Object Properties
Object
AppleScript
Properties
Visual Basic
Properties
JavaScript
Properties
Document
height
width
Height
Width
height
width
EPS open options
height
width
Height
Width
height
width
PDF open options
height
width
Height
Width
height
width
lens flare open
options
height
width
Height
Width
height
width
offset filter
horizontal offset
vertical offset
HorizontalOffset
VerticalOffset
horizontalOffset
verticalOffset