
Photoshop 7.0 Scripting Guide
81
Scripting Photoshop
Clipboard interaction
3
I M P O R TA N T:
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
O T E
:
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
O T E
:
In AppleScript, you must select the entire layer before performing the copy.
VB:
docRef.ArtLayers(2).Copy
JS:
docRef.artLayers[1].copy();