Adobe 23101764 Scripting Guide - Page 53

docRef.Selection.Select ArrayArray0, 0

Page 53 highlights

Scripting Photoshop 3 Advanced Scripting You can now apply a wave filter to the selection. A truncated sin curve carries the text along for a roller-coaster-like ride. docWidthInPixels = docWidthInInches * resolution docHeightInPixels = docHeightInInches * resolution newTextLayer.Rasterize Photoshop.PsRasterizeType.psTextContents docRef.Selection.Select Array(Array(0, 0), _ Array(docWidthInPixels / 2, 0), _ Array(docWidthInPixels / 2, docHeightInPixels), _ Array(0, docHeightInPixels), Array(0, 0)) newTextLayer.ApplyWave 1, 1, 100, 5, 10, 100, 100, _ Photoshop.PsWaveType.psSine, _ Photoshop.PsUndefinedAreas.psWrapAround, 0 This code snippet manipulates and bends the text on the left side of the document. Applying a MotionBlur Filter Similar code can be used to blur the text in a document. Again create an array of points to designate an area of the document. This time the width is defined as the distance from the middle of the document to the far right side. The vertical positioning remains the same. Select the right side of the document and apply a motion filter with parameters that define the angle and radius of the blur. Then remove the selection so that the "marching ants" disappear from the dialog. Photoshop CS Scripting Guide 49

  • 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
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105

Photoshop CS Scripting Guide
49
Scripting Photoshop
Advanced Scripting
3
You can now apply a wave
lter to the selection. A truncated sin curve carries the text along
for a roller-coaster-like ride.
docWidthInPixels = docWidthInInches * resolution
docHeightInPixels = docHeightInInches * resolution
newTextLayer.Rasterize
Photoshop.PsRasterizeType.psTextContents
docRef.Selection.Select Array(Array(0, 0), _
Array(docWidthInPixels / 2, 0), _
Array(docWidthInPixels / 2, docHeightInPixels), _
Array(0, docHeightInPixels), Array(0, 0))
newTextLayer.ApplyWave 1, 1, 100, 5, 10, 100, 100, _
Photoshop.PsWaveType.psSine, _
Photoshop.PsUndefinedAreas.psWrapAround, 0
This code snippet manipulates and
bends
the text on the left side of the document.
Applying a MotionBlur Filter
Similar code can be used to blur the text in a document. Again create an array of points to
designate an area of the document. This time the width is de
ned as the distance from the
middle of the document to the far right side. The vertical positioning remains the same.
Select the right side of the document and apply a motion
lter with parameters that de
ne the
angle and radius of the blur. Then remove the selection so that the "marching ants" disappear
from the dialog.