Adobe 23101335 Scripting Guide - Page 83

Paste, 3.16.5 Paste into command, Set newLayerRef = docRef.Paste True

Page 83 highlights

Scripting Photoshop 3 Clipboard interaction 3.16.4 Paste The paste command can be used on any open document, and operates on the current document. You must make the paste command's target document the current document before using the command. A new layer is created by the paste command, and a reference to it is returned. If there is no selection in the target document, the contents of the clipboard are pasted into the geometric center of the document. Here's how to paste into a document named "Doc2": AS: activate set current document to document "Doc2" set newLayerRef to paste In Visual Basic and JavaScript the paste command is defined on the Document object. VB: appRef.ActiveDocument = appRef.Documents("Doc2") Set newLayerRef = docRef.Paste JS: activeDocument = documents["Doc2"]; var newLayerRef = docRef.paste(); 3.16.5 Paste into command The paste into command allows you to paste the contents of the clipboard into the selection in a document. The destination selection border is then converted into a layer mask. As for the paste command, you must make the paste command's target document the current document before using the command. AS: activate set newLayerRef to paste with clipping to selection VB: Set newLayerRef = docRef.Paste (True) JS: newLayerRef = docRef.paste( true ); Photoshop 7.0 Scripting Guide 83

  • 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
83
Scripting Photoshop
Clipboard interaction
3
3.16.4 Paste
The paste command can be used on any open document, and operates on the current
document. You must make the paste command's target document the current document before
using the command. A new layer is created by the paste command, and a reference to it is
returned. If there is no selection in the target document, the contents of the clipboard are
pasted into the geometric center of the document.
Here’s how to paste into a document named “Doc2”:
AS:
activate
set current document to document "Doc2"
set newLayerRef to paste
In Visual Basic and JavaScript the paste command is defined on the Document object.
VB:
appRef.ActiveDocument = appRef.Documents("Doc2")
Set newLayerRef = docRef.Paste
JS:
activeDocument = documents["Doc2"];
var newLayerRef = docRef.paste();
3.16.5 Paste into command
The paste into command allows you to paste the contents of the clipboard into the selection in
a document. The destination selection border is then converted into a layer mask. As for the
paste command, you must make the paste command's target document the current document
before using the command.
AS:
activate
set newLayerRef to paste with clipping to selection
VB:
Set newLayerRef = docRef.Paste (True)
JS:
newLayerRef = docRef.paste( true );