Adobe 23102480 Scripting Guide - Page 53

Working with Filters, AS, VBS, JS, Other Filters

Page 53 highlights

Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 53 AS set myWebSafeColor to web safe color for foreground color VBS Dim myWebSafeColor Set myWebSafeColor = appRef.ForegroundColor.NearestWebColor JS var webSafeColor = new RGBColor() webSafeColor = app.foregroundColor.nearestWebColor Working with Filters To apply a filter in AppleScript, you use the filter command with an option from the class filter options. In VBScript and JavaScript, you use a specific filter method. For example, to apply a Gaussian blur filter, you use the ApplyGaussianBlur/applyGaussianBlur() method. All filter methods belong to the ArtLayer object. Note: Please refer to Photoshop CS3 Help for information about the effects produced by individual filter types. The following examples apply the Gaussian blur filter to the active layer. AS Use the filter command and then both specify the layer and the name of the filter and any options. filter current layer of current document using gaussian blur ¬ with options {radius:5} Note: In the Adobe Photoshop CS3 AppleScript Scripting Reference, or in the Photoshop CS3 AppleScript Dictionary, look up the filter command; also look up class filter options. VBS appRef.docRef.ActiveLayer.ApplyGaussianBlur 5 Note: In the Adobe Photoshop CS3 Visual Basic Scripting Reference, on in the Visual Basic Object Browser look up the ApplyGaussianBlur method and other methods of the ArtLayer object whose name begins with 'Apply'. JS docRef.activeLayer.applyGaussianBlur(5) Note: In the Adobe Photoshop CS3 JavaScript Scripting Reference, or in the ExtendScript Object Model Viewer look up the applyGaussianBlur() method and other methods of the artLayer object whose name begins with 'apply'. Other Filters If the filter type that you want to use on your layer is not part of the scripting interface, you can use the Action Manager from a JavaScript to run a filter. If you are using AppleScript or VBScript, you can run the

  • 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
53
AS
set myWebSafeColor to web safe color for foreground color
VBS
Dim myWebSafeColor
Set myWebSafeColor = appRef.ForegroundColor.NearestWebColor
JS
var webSafeColor = new RGBColor()
webSafeColor = app.foregroundColor.nearestWebColor
Working with Filters
To apply a filter in AppleScript, you use the
filter
command with an option from the class
filter
options
. In VBScript and JavaScript, you use a specific filter method. For example, to apply a Gaussian blur
filter, you use the
ApplyGaussianBlur/applyGaussianBlur()
method. All filter methods belong to the
ArtLayer
object.
Note:
Please refer to Photoshop CS3 Help for information about the effects produced by individual filter
types.
The following examples apply the Gaussian blur filter to the active layer.
AS
Use the
filter
command and then both specify the layer and the name of the filter and any options.
filter current layer of current document using gaussian blur ¬
with options {radius:5}
Note:
In the
Adobe Photoshop CS3 AppleScript Scripting Reference
, or in the Photoshop CS3 AppleScript
Dictionary, look up the
filter
command; also look up class
filter options
.
VBS
appRef.docRef.ActiveLayer.ApplyGaussianBlur 5
Note:
In the
Adobe Photoshop CS3 Visual Basic Scripting Reference
, on in the Visual Basic Object Browser
look up the
ApplyGaussianBlur
method and other methods of the
ArtLayer
object whose name
begins with ‘
Apply
’.
JS
docRef.activeLayer.applyGaussianBlur(5)
Note:
In the
Adobe Photoshop CS3 JavaScript Scripting Reference
, or in the ExtendScript Object Model
Viewer look up the
applyGaussianBlur()
method and other methods of the
artLayer
object
whose name begins with ‘
apply’
.
Other Filters
If the filter type that you want to use on your layer is not part of the scripting interface, you can use the
Action Manager from a JavaScript to run a filter. If you are using AppleScript or VBScript, you can run the