Adobe 23102480 Scripting Guide - Page 54
Understanding Clipboard Interaction, Using the Copy and Paste commands
UPC - 883919080222
View all Adobe 23102480 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 54 highlights
Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 54 JavaScript from your script. See 'Action Manager' on page 72 for information on using the Action Manager. Also, see 'Executing JavaScripts from AS or VBS' on page 9. 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 'Setting Application Preferences' on page 30 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