Adobe 23102480 Scripting Guide - Page 70

To apply a motionblur filter to HelloWorldDoc, Adobe Photoshop CS3 AppleScript Scripting Reference

Page 70 highlights

Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 70 set theSelRegion to {{theDocWidthInPixels / 2, 0},¬ {theDocWidthInPixels, 0}, ¬ {theDocWidthInPixels, theDocHeightInPixels}, ¬ {theDocWidthInPixels / 2, theDocHeightInPixels}, ¬ {theDocWidthInPixels / 2, 0}} select theDocRef region theSelRegion combination type replaced filter current layer of theDocRef using motion blur ¬ with options {class:motion blur, angle:45, radius:5} deselect theDocRef 2. Choose Run to run the script. Note: Look up the motion blur class in the Adobe Photoshop CS3 AppleScript Scripting Reference, or in the Photoshop CS3 AppleScript Dictionary to see if you understand how you used it in this script: VBS ➤ To apply a motionblur filter to HelloWorldDoc: 1. Type the following code into the script file HelloWorldDoc just above the statements that restore original preferences. docRef.Selection.Select Array(Array(docWidthInPixels / 2, 0), _ Array(docWidthInPixels, 0), _ Array(docWidthInPixels, docHeightInPixels), _ Array(docWidthInPixels / 2, docHeightInPixels), _ Array(docWidthInPixels / 2, 0)) newTextLayer.ApplyMotionBlur 45, 5 docRef.Selection.Deselect 2. Double click on the file in Windows Explorer to run the script. Note: Look up the ArtLayer class: ApplyMotionBlur method in the Adobe Photoshop CS3 Visual Basic Scripting Reference, or in the Visual Basic Object Browser to see if you understand how you used it in this script: JS ➤ To apply a motionblur filter to HelloWorldDoc: 1. Type the following code into the script file HelloWorldDoc just above the statements that restore original preferences. //change the value of selRegion to the other half of the document selRegion = Array(Array(docWidthInPixels / 2, 0), Array(docWidthInPixels, 0), Array(docWidthInPixels, docHeightInPixels), Array(docWidthInPixels / 2, docHeightInPixels), Array(docWidthInPixels / 2, 0)) docRef.selection.select(selRegion) newTextLayer.applyMotionBlur(45, 5) docRef.selection.deselect()

  • 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
70
set theSelRegion to {{theDocWidthInPixels / 2, 0},¬
{theDocWidthInPixels, 0}, ¬
{theDocWidthInPixels, theDocHeightInPixels}, ¬
{theDocWidthInPixels / 2, theDocHeightInPixels}, ¬
{theDocWidthInPixels / 2, 0}}
select theDocRef region theSelRegion combination type replaced
filter current layer of theDocRef using motion blur ¬
with options {class:motion blur, angle:45, radius:5}
deselect theDocRef
2.
Choose
Run
to run the script.
Note:
Look up the
motion blur
class in the
Adobe Photoshop CS3 AppleScript Scripting Reference
, or in the
Photoshop CS3 AppleScript Dictionary to see if you understand how you used it in this script:
VBS
To apply a motionblur filter to HelloWorldDoc:
1.
Type the following code into the script file
HelloWorldDoc
just above the statements that restore
original preferences.
docRef.Selection.Select Array(Array(docWidthInPixels / 2, 0), _
Array(docWidthInPixels, 0), _
Array(docWidthInPixels, docHeightInPixels), _
Array(docWidthInPixels / 2, docHeightInPixels), _
Array(docWidthInPixels / 2, 0))
newTextLayer.ApplyMotionBlur 45, 5
docRef.Selection.Deselect
2.
Double click on the file in Windows Explorer to run the script.
Note:
Look up the
ArtLayer
class:
ApplyMotionBlur
method in the
Adobe Photoshop CS3 Visual Basic
Scripting Reference
, or in the Visual Basic Object Browser to see if you understand how you used it in
this script:
JS
To apply a motionblur filter to HelloWorldDoc:
1.
Type the following code into the script file
HelloWorldDoc
just above the statements that restore
original preferences.
//change the value of selRegion to the other half of the document
selRegion = Array(Array(docWidthInPixels / 2, 0),
Array(docWidthInPixels, 0),
Array(docWidthInPixels, docHeightInPixels),
Array(docWidthInPixels / 2, docHeightInPixels),
Array(docWidthInPixels / 2, 0))
docRef.selection.select(selRegion)
newTextLayer.applyMotionBlur(45, 5)
docRef.selection.deselect()