Adobe 65048599 Scripting Guide - Page 54

Other filters, Understanding Clipboard Interaction, Using the copy and paste commands

Page 54 highlights

CHAPTER 3: Scripting Photoshop Understanding Clipboard Interaction 54 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 CS5 AppleScript Scripting Reference, or in the Photoshop AppleScript Dictionary, look up the filter command; also look up class filter options. VBS appRef.docRef.ActiveLayer.ApplyGaussianBlur 5 NOTE: In the Adobe Photoshop CS5 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 CS5 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 JavaScript from your script. See "Action Manager" on page 73 for information on using the Action Manager. Also, see "Executing JavaScripts from AS or VBS" on page 10. Understanding Clipboard Interaction The clipboard commands in Photoshop operate on ArtLayer, Selection, and Document objects. The commands can be used to operate on objects within a single document, or to move information between documents. The clipboard commands of the art layer (ArtLayer/ArtLayer) and selection (Selection/Selection) objects are: ➤ copy (Copy/copy) ➤ copy merged (Copy Merge parameter value/copy(merge parameter value)) ➤ cut(Cut/cut) The clipboard commands of the document/Document/Document object are: ➤ paste (Paste/paste) ➤ paste into (Paste IntoSelection parameter value/paste(intoSelection parameter value)) NOTE: For information on copy, copy merged, paste, paste into, and cut functions, see Photoshop Help. Using the copy and paste commands The following examples copy the contents of the background layer to the clipboard, create a new document, and then paste the clipboard contents to the new document. The scripts assume that there is a document already open in Photoshop and that the document has a background layer.

  • 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

C
HAPTER
3: Scripting Photoshop
Understanding Clipboard Interaction
54
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}
N
OTE
:
In the
Adobe Photoshop CS5 AppleScript Scripting Reference
, or in the Photoshop AppleScript
Dictionary, look up the
filter
command; also look up class
filter
options
.
VBS
appRef.docRef.ActiveLayer.ApplyGaussianBlur 5
N
OTE
:
In the
Adobe Photoshop CS5 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)
N
OTE
:
In the
Adobe Photoshop CS5 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
JavaScript from your script. See
“Action Manager” on page 73
for information on using the Action
Manager. Also, see
“Executing JavaScripts from AS or VBS” on page 10
.
Understanding Clipboard Interaction
The clipboard commands in Photoshop operate on
ArtLayer
,
Selection
, and
Document
objects. The
commands can be used to operate on objects within a single document, or to move information between
documents.
The clipboard commands of the
art layer (ArtLayer/ArtLayer)
and
selection
(Selection/Selection)
objects are:
copy
(Copy/copy)
copy
merged
(Copy
Merge
parameter
value/copy(merge
parameter
value))
cut(Cut/cut)
The clipboard commands of the
document/Document/Document
object are:
paste
(Paste/paste)
paste
into
(Paste
IntoSelection
parameter
value/paste(intoSelection
parameter
value))
N
OTE
:
For information on copy, copy merged, paste, paste into, and cut functions, see Photoshop Help.
Using the copy and paste commands
The following examples copy the contents of the background layer to the clipboard, create a new
document, and then paste the clipboard contents to the new document. The scripts assume that there is a
document already open in Photoshop and that the document has a background layer.