
Photoshop 7.0 Scripting Guide
73
Scripting Photoshop
Selections
3
3.11.7 Loading and storing selections
Scripting Support exposes the functionality to store and load selections. Selections get stored
into channels and loaded from channels.The following examples will store the current
selection into a channel named “My Channel” and extend the selection with any selection that
is currently in that channel.
AS:
store selection of current document into channel "My Channel" of ¬
current document combination type extended
VB:
selRef.Store docRef.Channels("My Channel"), psExtendSelection
JS:
selRef.store(docRef.channels["My Channel"], SelectionType.EXTEND);
To restore a selection that has been saved to a selection, use the load (Load/load) method as
shown below.
AS:
load selection of current document from channel "My Channel" of ¬
current document combination type extended
VB:
selRef.Load docRef.Channels("My Channel"), psExtendSelection
JS:
selRef.load (docRef.channels["My Channel"], SelectionType.EXTEND);
See section
3.16, “Clipboard interaction” on page 81
for examples on how to copy, cut and
paste selections.