Adobe 23101335 Scripting Guide - Page 40
Set artLayerRef = docRef.ArtLayers.Add, Set appRef = CreateObject Photoshop.Application
UPC - 718659152833
View all Adobe 23101335 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 40 highlights
Scripting Photoshop 3 Your first Photoshop script Here's an example VBScript: ' Hello World Script Dim appRef Set appRef = CreateObject( "Photoshop.Application" ) ' Remember current unit settings and then set units to ' the value expected by this script Dim originalRulerUnits originalRulerUnits = appRef.Preferences.RulerUnits appRef.Preferences.RulerUnits = 2 ' Create a new 4x4 inch document and assign it to a variable. Dim docRef Dim artLayerRef Dim textItemRef Set docRef = appRef.Documents.Add(4, 4) ' Create a new art layer containing text Set artLayerRef = docRef.ArtLayers.Add artLayerRef.Kind = 2 ' Set the contents of the text layer. Set textItemRef = artLayerRef.TextItem textItemRef.Contents = "Hello, World!" ' Restore unit setting appRef.Preferences.RulerUnits = originalRulerUnits To run this script create a text file and copy the script into it. Save the file with a "vbs" extension. Double-click the file to execute. Photoshop 7.0 Scripting Guide 40