Photoshop CS2
Adobe Photoshop CS2 Scripting Guide
Scripting Photoshop CS2 67
Using the Copy and Paste Commands/Methods
The following examples copy the contents an 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 CS2 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
‘Setting Application
Preferences’ on page 46
for information.
AS
Note:
On Mac OS, Photoshop CS2 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 CS2”
activate
select all of current document
set current layer of current document to layer "Background" of ¬
current document
set newDocRef to make new document
past newDocRef
Note:
In AppleScript, you must select the entire layer before performing the copy.
VBS
//make firstDocument the active document
Set docRef = appRef.ActiveDocument
appRef.docRef.ArtLayers("Background").Copy
Set newDocRef = Documents.Add(8, 6, 72, "New Doc")
newDocRef.Paste
JS
//make firstDocument the active document
var docRef = app.activeDocument
docRef.artLayers["Background"].copy()
var newDocRef = app.documents.add(8, 6, 72, "New Doc")
newDocRef.paste()
Using the Copy Merged Command/Method
You can also perform a merged copy to copy of all visible layers in the selected area.
AS
Note:
On Mac OS, Photoshop CS2 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.
activate
select all of current document
copy merged selection of current document
Содержание PHOTOSHOP CS 2.0 - SCRIPTING GUIDE
Страница 1: ...bbc Adobe Photoshop cs 2 Scripting Guide ...