Adobe Smoke Alarm CS3 Manuale Utente

Pagina di 85
Photoshop CS3
Adobe Photoshop CS3  Scripting Guide
 Scripting Photoshop CS3     54
JavaScript from your script. See 
 for information on using the Action Manager. 
.
Understanding Clipboard Interaction
The clipboard commands in Photoshop CS3 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 CS3 
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 CS3 and that the document has a background layer. 
Note:
If your script creates a new document in which you paste the clipboard contents, be sure the 
document uses the same ruler units as the original document. See 
 for information. 
AS
Note:
On Mac OS, Photoshop CS3 must be the front-most application when executing these commands. 
You must use the 
activate
 command to activate the application before executing any clipboard 
commands.
tell application "Adobe Photoshop CS3"
activate
select all of current document
copy
set current layer of current document to layer "Background" ¬
of current document
set newDocRef to make new document
paste newDocRef
end tell
VBS
'make firstDocument the active document
Set docRef = appRef.ActiveDocument 
docRef.ArtLayers("Background").Copy