Adobe 23102480 Scripting Guide

Adobe 23102480 - Photoshop CS3 - PC Manual

Adobe 23102480 manual content summary:

  • Adobe 23102480 | Scripting Guide - Page 1
    SCRIPTING GUIDE bc
  • Adobe 23102480 | Scripting Guide - Page 2
    Systems Incorporated. All rights reserved. Adobe® Creative Suite® 3 Photoshop® Scripting Guide for Windows® and Macintosh®. NOTICE: All information contained herein is the property of Adobe Systems Incorporated. No part of this publication (whether in hardcopy or electronic form) may be reproduced
  • Adobe 23102480 | Scripting Guide - Page 3
    About this manual...5 Conventions in this guide ...5 2 Photoshop CS3 Scripting Basics 7 Scripting Overview ...7 Why use scripts instead of actions?...7 Scripting Support in Photoshop CS3 ...8 JavaScript Support...8 Startup Scripts...9 Executing JavaScripts from AS or VBS ...9 Photoshop CS3 Object
  • Adobe 23102480 | Scripting Guide - Page 4
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Contents 4 Working with Channel Objects ...45 Using the Document Info Object ...46 Using History State Objects...46 Using Notifier Objects ...47 Using the PathItem Object ...
  • Adobe 23102480 | Scripting Guide - Page 5
    introduction to scripting Adobe® Photoshop® CS3 on Mac OS® and Windows®. Chapter one covers the basic conventions used in this manual. Chapter two covers a brief overview of scripting, how to execute scripts, and the Photoshop CS3 object model. Chapter three covers Photoshop CS3-specific objects and
  • Adobe 23102480 | Scripting Guide - Page 6
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Introduction 6 In this case, display dialogs refers to the AppleScript property, DisplayDialogs refers to the VBScript property and displayDialogs refers to the JavaScript property. For
  • Adobe 23102480 | Scripting Guide - Page 7
    please use the reference information in the three reference manuals provided with this installation: Adobe Photoshop CS3 AppleScript Scripting Reference, Adobe Photoshop CS3 Visual Basic Scripting Reference, and Adobe Photoshop CS3 JavaScript Scripting Reference. Note: You can also view information
  • Adobe 23102480 | Scripting Guide - Page 8
    the Microsoft JScript engine, and it cannot launch Photoshop CS3. For Windows, using the .jsx extension is preferable, since it interprets the script with the ExtendScript engine. Scripts written in JavaScript can be accessed from the Adobe Photoshop CS3 Scripts menu (File > Scripts), which provides
  • Adobe 23102480 | Scripting Guide - Page 9
    startup folders. ● On Windows, the startup folder for user-defined scripts is: C:\Program Files\Common Files\Adobe\Startup Scripts CS3\Adobe Photoshop ● On Mac OS, the startup folder for user-defined scripts is: ~/Library/Application Support/Adobe/Startup Scripts CS3/Adobe Photoshop If your script
  • Adobe 23102480 | Scripting Guide - Page 10
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 10 a new document, add a layer to an existing document, or change the background color of a layer. Most of the functionality available through the Photoshop CS3 user interface is available through the DOM. A good
  • Adobe 23102480 | Scripting Guide - Page 11
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 11 The Application class is the root of the Photoshop CS3 to store pixel information about an image's color. Image color determines the number of channels available. An RGB image, for example, has four default
  • Adobe 23102480 | Scripting Guide - Page 12
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 12 History State Class The History State class is scripting support for the new Measurement Scale feature that allows you to set a scale for your document. The Containment Hierarchy and the Photoshop CS3 User
  • Adobe 23102480 | Scripting Guide - Page 13
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 13 Object Name Description To create this object without using a script: Application The Photoshop CS3 application. Start the Photoshop CS3 about an image's color. Choose Window > Channels. Art Layer A layer
  • Adobe 23102480 | Scripting Guide - Page 14
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 14 Object Name Description Color Sampler Represents a color sampler in your document. Count Item Represents a counted item in the document. Measurement Represents the
  • Adobe 23102480 | Scripting Guide - Page 15
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 15 Creating a Sample Hello World Script This section demonstrates a very simple script in each of the three scripting languages for Photoshop CS3. Traditionally, the first thing to accomplish in any programming
  • Adobe 23102480 | Scripting Guide - Page 16
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 16 Note: The lines preceded by "--" are comments. Entering the comments is optional. -- Sample script to create a new text item and -- change its contents. --target Photoshop CS3 tell application "Adobe Photoshop CS3
  • Adobe 23102480 | Scripting Guide - Page 17
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 17 appRef.Preferences.RulerUnits = originalRulerUnits 2. Save file as a text file with a .vbs file name extension. 3. Double-click the file in Windows Explorer to run the script. The script opens Photoshop CS3.
  • Adobe 23102480 | Scripting Guide - Page 18
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 18 Note: Photoshop CS3 also supports JavaScript files that use a .js extension. 3. Do either of the following: ● If Photoshop CS3 is already open, choose File > Scripts > Browse, and then navigate to the Presets >
  • Adobe 23102480 | Scripting Guide - Page 19
    these instructions will help you quickly understand how to script Photoshop CS3. Viewing Photoshop CS3 Objects, Commands, and Methods The Photoshop CS3 reference material for each of the three scripting languages is found in the reference manuals provided in this installation: ● Adobe Photoshop CS3
  • Adobe 23102480 | Scripting Guide - Page 20
    Edit Custom Component Set. 4. On the COM tab, find "Adobe Photoshop CS3 Object Library". Select it. 5. Click Add. The selected library appears in the "Selected Projects and Components" portion of the window. 6. Click OK. 7. Now the Photoshop CS3 Library is loaded into the object browser. Click on
  • Adobe 23102480 | Scripting Guide - Page 21
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 21 ... end tell Note: Because you include all commands in the tell block, there is no need to reference the Application object throughout the script.
  • Adobe 23102480 | Scripting Guide - Page 22
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 22 set docRef to make new has index 1, rather than index 0. If you look up in the Document object in the Adobe Photoshop CS3 Visual Basic Scripting Reference or in the Visual Basic Object Browser, you will see that there is
  • Adobe 23102480 | Scripting Guide - Page 23
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 23 JS In JavaScript, you can selection, or channel. For example, if you look at the Application object in the Adobe Photoshop CS3 JavaScript Scripting Reference, or in the ExtendScript Object Model Viewer, you find one of
  • Adobe 23102480 | Scripting Guide - Page 24
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 24 Setting the Active Document The following examples demonstrate how to set the active document. AS --create 2 documents set docRef to make new document with
  • Adobe 23102480 | Scripting Guide - Page 25
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 25 Setting the Active Layer The = docRef.Layers(1) Look up the ActiveLayer property on the Document object in the Adobe Photoshop CS3 Visual Basic Scripting Reference, or in the Visual Basic Object Browser. Note: You
  • Adobe 23102480 | Scripting Guide - Page 26
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 26 ' This example assumes docRef the document) with the command. Opening a File with Default File Format Because Photoshop CS3 supports many different file formats, the open/Open/open() command lets you specify the format
  • Adobe 23102480 | Scripting Guide - Page 27
    , or the Adobe Photoshop CS3 JavaScript Scripting Reference, look up the PhotoCDOpenOptions or EPSOpenOptions objects. The following examples demonstrate how to open a generic (multi-page/multi-image) PDF document with the following specifications: ● The document will open in a window that is 100
  • Adobe 23102480 | Scripting Guide - Page 28
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 28 VBS Dim appRef Set appRef = CreateObject("Photoshop.Application") 'Remember Universal Resource Identifier (URI) notation. Please see the JavaScript Tools Guide for more information. // Set the ruler units to pixels var
  • Adobe 23102480 | Scripting Guide - Page 29
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 29 Saving a Document Options for saving documents in Photoshop CS3 are illustrated below. To find out which properties you can specify for a specific file format save option, look up the object that begins with the
  • Adobe 23102480 | Scripting Guide - Page 30
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 30 Set docRef = appRef.Documents.Add() Set jpgSaveOptions = CreateObject("Photoshop.JPEGSaveOptions") jpgSaveOptions.EmbedColorProfile = True jpgSaveOptions.FormatOptions = 1 'for psStandardBaseline jpgSaveOptions.Matte = 1
  • Adobe 23102480 | Scripting Guide - Page 31
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 31 preferences.typeUnits = TypeUnits.PIXELS In the Adobe Photoshop CS3 JavaScript Scripting Reference, or in the ExtendScript Object Model Viewer, look up the Preferences object to view all of the settings properties you
  • Adobe 23102480 | Scripting Guide - Page 32
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 32 You use the properties and commands of the Application object to work with Photoshop CS3 functionality and objects such as the following: ● Global Photoshop CS3 settings or preferences, such as unit values or color
  • Adobe 23102480 | Scripting Guide - Page 33
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 33 ● Crop the image. ● Flip the entire window. ● Restore the original ruler units. Note: See 'Setting Application Preferences' on page 30 for information on ruler units. AS tell application "Adobe Photoshop CS3" set
  • Adobe 23102480 | Scripting Guide - Page 34
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 34 JS //save original ruler units, then assign it to with red at the beginning of the current document. AS tell application "Adobe Photoshop CS3" make new document make new art layer at beginning of current document ¬
  • Adobe 23102480 | Scripting Guide - Page 35
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 35 VBS Dim appRef Set appRef = CreateObject("Photoshop.Application") ' Create a new art layer at the beginning of the current document Dim docRef Dim layerObj Set docRef = appRef.Documents.Add() Set layerObj = appRef.
  • Adobe 23102480 | Scripting Guide - Page 36
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 36 end tell VBS Dim appRef Set appRef = CreateObject("Photoshop.Application") 'Make a in the Photoshop CS3 application (rather than a script), the layer is added to the Layers palette and given a number. These numbers act as
  • Adobe 23102480 | Scripting Guide - Page 37
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 37 Note: Unlike object references in JavaScript or VBScript, AppleScript object reference names do not remain constant. Refer to an AppleScript language guide or text book for information on referencing a file using either
  • Adobe 23102480 | Scripting Guide - Page 38
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 38 Linking Layer Objects Scripting also supports linking and unlinking Look up Link in as a method of the ArtLayer object in the Adobe Photoshop CS3 Visual Basic Scripting Reference, or in the Visual Basic Object Browser.
  • Adobe 23102480 | Scripting Guide - Page 39
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 39 VBS docRef.ArtLayers("L1").ApplyStyle "Puzzle (Image)" Look up ApplyStyle as a method of the ArtLayer object in the Adobe Photoshop CS3 Visual Basic Scripting Reference, or in the Visual Basic Object Browser. JS docRef.
  • Adobe 23102480 | Scripting Guide - Page 40
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 40 Determining a Layer's Kind The following examples use an if statement to check whether an existing layer is a text layer. AS if (kind of layerRef
  • Adobe 23102480 | Scripting Guide - Page 41
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 41 (psParagraphText/TextType.PARAGRAPHTEXT. ) When a use with a text layer, look up the TextItem object. ● In the Adobe Photoshop CS3 JavaScript Scripting Reference, or in the ExtendScript Object Model Viewer, look up the
  • Adobe 23102480 | Scripting Guide - Page 42
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 42 ➤ The following examples assume that the ruler light opacity 75 ¬ without preserving transparency VBS Set strokeColor = CreateObject ("Photoshop.SolidColor") strokeColor.CMYK.Cyan = 20 strokeColor.CMYK.Magenta = 50
  • Adobe 23102480 | Scripting Guide - Page 43
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 43 JS strokeColor = new solidColor strokeColor.cmyk.cyan , and feather commands. The values are passed in the ruler units stored in Photoshop CS3 preferences and can be changed by your scripts. If your ruler units are set
  • Adobe 23102480 | Scripting Guide - Page 44
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 44 AS fill selection of current document with contents ¬ {class:RGB color, red:255, green:0, blue:0} blend mode ¬ vivid light opacity 25 without preserving transparency VBS Set fillColor = CreateObject("Photoshop.SolidColor
  • Adobe 23102480 | Scripting Guide - Page 45
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 45 VBS Set chanRef = docRef.Channels.Add chanRef.Name = "My Channel" chanRef.Kind = 3 'psSelectedAreaAlphaChannel docRef.Selection.Store docRef.Channels("My Channel"), 2 'PsSelectionType is 2 (psExtendSelection) JS
  • Adobe 23102480 | Scripting Guide - Page 46
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 46 AS set kind of myChannel to selected area the Photoshop CS3 application, you create a history state; you can access a document's history states from the History palette by selecting Window > History. See Photoshop CS3
  • Adobe 23102480 | Scripting Guide - Page 47
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 47 In a script, you can access a Document object's history object to tie an event to a script. For example, if you would like Photoshop CS3 to automatically create a new document when you open the application, you could tie
  • Adobe 23102480 | Scripting Guide - Page 48
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 48 Note: This type of script corresponds to selecting Start Application in the Script Events Manager (File > Scripts > Script Events Manager) in the Photoshop CS3 application. Please refer to Photoshop CS3 Help for
  • Adobe 23102480 | Scripting Guide - Page 49
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 49 AS --line #1--it's a straight line so the coordinates for anchor, left, and --right for each point have the same coordinates tell application "Adobe Photoshop CS3" set ruler units of settings to pixel units set type
  • Adobe 23102480 | Scripting Guide - Page 50
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 50 ' stroke it so we can see something myPathItem.StrokePath(2) 'for scripts can use the same range of colors that are available from the Photoshop CS3 user interface. Each color model has its own set of properties. For
  • Adobe 23102480 | Scripting Guide - Page 51
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 VBS 'create a solidColor array Dim solidColorRef Set solidColorRef = CreateObject("Photoshop.SolidColor") solidColorRef.CMYK.Cyan = 20 solidColorRef.CMYK.Magenta = 90 solidColorRef.CMYK.Yellow = 50 solidColorRef.CMYK.Black = 50 appRef.
  • Adobe 23102480 | Scripting Guide - Page 52
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 52 AS The following script, which assumes an color to CMYK Look up the following in the Adobe Photoshop CS3 AppleScript Scripting Reference or in the Photoshop CS3 AppleScript Dictionary: ● In the "Objects" section, the
  • Adobe 23102480 | Scripting Guide - Page 53
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 53 AS set myWebSafeColor to web safe color for foreground color VBS Dim myWebSafeColor Set myWebSafeColor = appRef.ForegroundColor.NearestWebColor JS var webSafeColor = new RGBColor() webSafeColor =
  • Adobe 23102480 | Scripting Guide - Page 54
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 54 JavaScript from your script. See 'Action 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
  • Adobe 23102480 | Scripting Guide - Page 55
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 55 Set newDocRef = appRef.Documents.Add(8, 6, True Look up the Copy method for the ArtLayer and Selection objects in the Adobe Photoshop CS3 Visual Basic Scripting Reference, or in the Visual Basic Object Browser JS docRef
  • Adobe 23102480 | Scripting Guide - Page 56
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 56 ● A type ruler, which is active Photoshop CS3 preference dialog under Photoshop > Preferences > Units & Rulers on Mac OS or Edit > Preferences > Units & Rulers in Windows. Unit Values All languages support plain numbers
  • Adobe 23102480 | Scripting Guide - Page 57
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 a corresponding reference to cm or mm. They are not supported by the AppleScript terminology. Using Unit Values in Calculations To inch value write: set newValue to (inchValue as number) * 5 Note: In AppleScript you can get
  • Adobe 23102480 | Scripting Guide - Page 58
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 58 Class/Object offset filter Text Item AppleScript Properties horizontal offset vertical offset baseline shift* first line indent* height hyphenation zone* leading* left indent* position
  • Adobe 23102480 | Scripting Guide - Page 59
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 59 AppleScript translate (delta x, delta y) unit type settings of the two Photoshop CS3 rulers control how numbers are interpreted when dealing with properties and parameters that support unit values. Be sure to set
  • Adobe 23102480 | Scripting Guide - Page 60
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 60 Script Name Layer Comps to you initially installed and configured Photoshop CS3. Note: To view or set the Preferences on Mac OS, choose Photoshop > Preferences > Units & Rulers; in Windows choose Edit > Preferences >
  • Adobe 23102480 | Scripting Guide - Page 61
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 61 Preference rulers units dialog modes Set Running an AppleScript' on page 15 for details. tell application "Adobe Photoshop CS3" --make Photoshop CS3 the active (front-most) application activate --create variables for
  • Adobe 23102480 | Scripting Guide - Page 62
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 62 set display dialogs to theStartDisplayDialogs end tell 2. In Photoshop CS3, choose Photoshop 2. Double click the file name in Windows Explorer to run the script. 3. In Photoshop CS3, choose Edit > Preferences > Units &
  • Adobe 23102480 | Scripting Guide - Page 63
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 63 4. After viewing the document in Photoshop CS3, close the document without saving it. 5. Name the script HelloWorldDoc and save it. JS ➤ To work with document preferences: 1. Create the following script. Note: See '
  • Adobe 23102480 | Scripting Guide - Page 64
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 64 AS ➤ To create and specify details in a text item: 1. Type the following code into the HelloWorldDoc script immediately before the statements at the end
  • Adobe 23102480 | Scripting Guide - Page 65
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 65 'use the Kind property of the Art Layers class to 'make the layer a text layer newTextLayer.Kind = 2 newTextLayer.TextItem.Contents = helloWorldStr newTextLayer.TextItem.Position =
  • Adobe 23102480 | Scripting Guide - Page 66
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 66 Note: Look up the following classes in the Adobe Photoshop CS3 JavaScript coordinate is the total number of columns in the document divided by 2. Note: The value of theDocWidthInPixels is the total number of pixels that
  • Adobe 23102480 | Scripting Guide - Page 67
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 67 ● theDocHeightInPixels indicates the bottom row in the document; that is row whose coordinate is the total number of rows in the document. Note: The value of theDocHeightInPixels is the total number of pixels that
  • Adobe 23102480 | Scripting Guide - Page 68
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 68 Note: Look up the following classes in the Adobe Photoshop CS3 AppleScript Scripting Reference, or in the Photoshop CS3 AppleScript Dictionary to see if you understand how you used them in this script: ● wave filter
  • Adobe 23102480 | Scripting Guide - Page 69
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 69 JS ➤ To select an area and apply a wave height //convert inches to pixels by multiplying the number of inches by //the resolution (which equals number of pixels per inch) docWidthInPixels = docWidthInInches * resolution
  • Adobe 23102480 | Scripting Guide - Page 70
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 70 set theSelRegion to {{theDocWidthInPixels / 2, click on the file in Windows Explorer to run the script. Note: Look up the ArtLayer class: ApplyMotionBlur method in the Adobe Photoshop CS3 Visual Basic Scripting Reference,
  • Adobe 23102480 | Scripting Guide - Page 71
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 71 2. Save the script, and then open Photoshop CS3 and select the script from the Scripts menu (choose File > Script > HelloWorldDoc). Note: Look up the ArtLayer class applyMotionBlur() method in the Adobe Photoshop CS3
  • Adobe 23102480 | Scripting Guide - Page 72
    Photoshop CS3, ScriptListener creates several files, which contain code that represents the actions taken in Photoshop: ● ScriptingListenerJS.log, containing JavaScript code, ● ScriptingListenerVB.log, containing VBScript code (Windows in the ..\Adobe Photoshop CS3\Scripting Guide\Utilities folder.
  • Adobe 23102480 | Scripting Guide - Page 73
    in the ..\Adobe Photoshop CS3\Scripting Guide\Utilities folder. 3. Delete the file ScriptListener.8li from the following location: ..\Adobe Photoshop CS\Plug-Ins\Automate 4. Delete the log files ScriptingListenerJS.log and ScriptingListenerVB.log from your desktop. Note: In Windows, even though
  • Adobe 23102480 | Scripting Guide - Page 74
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 example in this section assumes you have followed the instructions in 'Recording a Script using ScriptListener' on page file you will see code similar to the following (although your numbers may be different): var id19 = charIDToTypeID( "Embs" );
  • Adobe 23102480 | Scripting Guide - Page 75
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Action Manager 75 desc4. in this section assumes you have followed the instructions in 'Recording a Script using ScriptListener' following (although your numbers may be different): DIM objApp SET objApp = CreateObject("Photoshop.Application") REM
  • Adobe 23102480 | Scripting Guide - Page 76
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Action Manager 76 DIM id9 id9 = objApp.CharIDToTypeID( "Embs" ) DIM desc4 SET desc4 = CreateObject( "Photoshop example, the function name is Emboss. The creation of the Photoshop application object needs to be outside of the function, as we
  • Adobe 23102480 | Scripting Guide - Page 77
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Action Manager 77 id9 = objApp.CharIDToTypeID( "Embs" ) DIM desc4 SET desc4 = CreateObject( "Photoshop.ActionDescriptor" ) DIM id10 id10 = objApp.CharIDToTypeID( "Angl" ) Call desc4.PutInteger( id10, angle ) DIM id11 id11 = objApp.CharIDToTypeID(
  • Adobe 23102480 | Scripting Guide - Page 78
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Action Manager 78 Running JavaScript-based Action Manager by saying (this example assumes emboss.jsx is found in C:\): Set objApp = CreateObject("Photoshop.Application") 'Open the document in the script filename = "C:\MyFile" DIM docRef SET docRef
  • Adobe 23102480 | Scripting Guide - Page 79
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Action Manager 79 desc7.putInteger( id34, height ); var id35 = charIDToTypeID( "null" ); desc5.putPath( id15, new File( "C:\\Program Files\\Adobe\\Adobe Photoshop CS3\\Samples\\Fish.psd" ) ); executeAction( id14, desc5, DialogModes.NO ); 4.
  • Adobe 23102480 | Scripting Guide - Page 80
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Action Manager 80 5. You can now use this class ID for the "New" event 1. Make sure that the ScriptListener plug in is installed. 2. Open Photoshop CS3, then create a new document using File > New. 3. Next, create a new channel, using the Create
  • Adobe 23102480 | Scripting Guide - Page 81
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Action Manager 81 desc9.putEnumerated( id36, id37, id38 ); var id39 = charIDToTypeID( "Clr " ); var desc10 = new ActionDescriptor(); var id40 = charIDToTypeID( "Rd " ); desc10.putDouble( id40, 255.000000 );
  • Adobe 23102480 | Scripting Guide - Page 82
    Guide Index A Action Manager defined 72 running JavaScript code from AppleScript 78 running JavaScript code from VBScript 78 scripting objects 73 using from JavaScript 74 using from VBScript 75 actions vs. scripts 7 working with 72 Actions palette 72 active objects, setting 23 Adobe Photoshop CS3
  • Adobe 23102480 | Scripting Guide - Page 83
    Adobe Photoshop CS3 Scripting Guide script files 8 files inferring format 26 opening 26 opening using 5 creating 17 executing 9 executing from AppleScript 9 executing from VBScript 9 running 17 support 8 using Action Manager 74 workflow automation sample 59 L layer classes 11 Layer Comp object
  • Adobe 23102480 | Scripting Guide - Page 84
    Adobe Photoshop CS3 Scripting Guide working with 60 Preferences object defined 12 relationship to user interface 13 properties conventions 5 finding 19 R ruler units defined 55 setting 59 value usage 57
  • Adobe 23102480 | Scripting Guide - Page 85
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Index 85
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85

b
SCRIPTING GUIDE