Adobe 23101335 Scripting Guide - Page 81

Filling a selection with a history state, 3.16 Clipboard interaction, 3.16.1 Copy

Page 81 highlights

Scripting Photoshop 3 Clipboard interaction IMPORTANT: Reverting back to a previous history state does not remove any latter states from the history collection. Use the Purge command to remove latter states from the history collection as shown below: AS: purge history caches VB: appRef.Purge( psHistoryCaches) JS: purge( PurgeTarget.HISTORYCACHES ); 3.15.1 Filling a selection with a history state A history state can also be used to fill a selection. See section 3.11, "Selections" on page 67 for more information on working with selections. 3.16 Clipboard interaction The clipboard commands in Photoshop Scripting Support operate on layers and selections. The commands can be used to operate on a single document, or to move information between documents. NOTE: On Mac OS, Photoshop must be the front-most application when executing these commands. You must activate the application before executing any clipboard commands. 3.16.1 Copy The example below shows how to copy the contents of art layer 2 to the clipboard. AS: activate select all of current document copy art layer 2 of current document NOTE: In AppleScript, you must select the entire layer before performing the copy. VB: docRef.ArtLayers(2).Copy JS: docRef.artLayers[1].copy(); Photoshop 7.0 Scripting Guide 81

  • 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
81
Scripting Photoshop
Clipboard interaction
3
IMPORTANT:
Reverting back to a previous history state does not remove any latter states
from the history collection. Use the
Purge
command to remove latter states
from the history collection as shown below:
AS:
purge history caches
VB:
appRef.Purge( psHistoryCaches)
JS:
purge( PurgeTarget.HISTORYCACHES );
3.15.1 Filling a selection with a history state
A history state can also be used to fill a selection. See section
3.11, “Selections” on page 67
for
more information on working with selections.
3.16 Clipboard interaction
The clipboard commands in Photoshop Scripting Support operate on layers and selections.
The commands can be used to operate on a single document, or to move information between
documents.
N
OTE
:
On Mac OS, Photoshop must be the front-most application when executing these
commands. You must activate the application before executing any clipboard
commands.
3.16.1 Copy
The example below shows how to copy the contents of art layer 2 to the clipboard.
AS:
activate
select all of current document
copy art layer 2 of current document
N
OTE
:
In AppleScript, you must select the entire layer before performing the copy.
VB:
docRef.ArtLayers(2).Copy
JS:
docRef.artLayers[1].copy();