Adobe 23101335 Scripting Guide - Page 68

Defining selections

Page 68 highlights

Scripting Photoshop 3 Selections AS: set current layer of current document to layer "Layer 1" of ¬ current document VB: docRef.ActiveLayer = docRef.Layers("Layer 1") JS: docRef.activeLayer = docRef.layers["Layer 1"]; See section 3.9.1, "Setting the Active layer" on page 61 for more information. 3.11.1 Defining selections To create a new selection, use the select method with a type of replaced (psReplaceSelection/SelectionType.REPLACED). The other selection types are diminished, extended and intersected. The diminished type will shrink the current selection, the extended selection type will grow the current selection, and the intersected type will find the intersection of the current selection and the new selection and replace the current selection with the intersection of the two. If there is no intersection between the selections, the new selection will be empty. If there is no current selection, the new selection will be the newly specified selection. Here are examples of how to replace the current selection: AS: select current document region {{ 5, 5}, {5, 100}, ¬ { 80, 100}, { 80, 5}} combination type replaced Photoshop 7.0 Scripting Guide 68

  • 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
68
Scripting Photoshop
Selections
3
AS:
set current layer of current document to layer "Layer 1" of ¬
current document
VB:
docRef.ActiveLayer = docRef.Layers("Layer 1")
JS:
docRef.activeLayer = docRef.layers["Layer 1"];
See section
3.9.1, “Setting the Active layer” on page 61
for more information.
3.11.1 Defining selections
To create a new selection, use the
select
method with a type of
replaced
(psReplaceSelection/SelectionType.REPLACED)
. The other selection types are
diminished, extended
and
intersected
.
The
diminished
type will shrink the current selection, the
extended
selection type will
grow the current selection, and the
intersected
type will find the intersection of the current
selection and the new selection and replace the current selection with the intersection of the
two.
If there is no intersection between the selections, the new selection will be empty. If there is no
current selection, the new selection will be the newly specified selection.
Here are examples of how to replace the current selection:
AS:
select current document region {{ 5, 5}, {5, 100}, ¬
{ 80, 100}, { 80, 5}} combination type replaced