Adobe 23102480 - Photoshop CS3 - PC Programming Manual
Adobe 23102480 - Photoshop CS3 - PC Programming Manual

Adobe 23102480 - Photoshop CS3 - PC Programming Manual

Scripting guide
Table of Contents

Advertisement

Quick Links

SCRIPTING GUIDE
b b
c

Advertisement

Table of Contents
loading

Summary of Contents for Adobe 23102480 - Photoshop CS3 - PC

  • Page 1 SCRIPTING GUIDE...
  • Page 2 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 or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior written consent of Adobe Systems Incorporated.
  • Page 3: Table Of Contents

    Contents Introduction ..........................5 About this manual..................................5 Conventions in this guide ................................5 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...................................
  • Page 4 Photoshop CS3 Adobe Photoshop CS3 Scripting Guide Contents Working with Channel Objects ............................45 Using the Document Info Object .............................46 Using History State Objects..............................46 Using Notifier Objects ................................47 Using the PathItem Object ..............................48 Working with Color Objects ..............................50 Getting and Converting Colors ............................51 Working with Filters ..................................53...
  • Page 5: Introduction

    About this manual ® ® ® ® This manual provides an 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.
  • Page 6 Photoshop CS3 Adobe Photoshop CS3 Scripting Guide Introduction In this case, refers to the AppleScript property, refers to the display dialogs DisplayDialogs VBScript property and refers to the JavaScript property. displayDialogs For larger blocks of code, scripting examples are listed on separate lines.
  • Page 7: Photoshop Cs3 Scripting Basics

    For detailed information on Photoshop CS3 objects and commands, 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.
  • Page 8: Scripting Support In Photoshop Cs3

    .jsx engine. Scripts written in JavaScript can be accessed from the Adobe Photoshop CS3 Scripts menu (File > Scripts), which provides quick and easy access to your JavaScripts. By putting a JavaScript file into the appropriate location on disk, it can be accessed directly from the Photoshop CS3 menu.
  • Page 9: Startup Scripts

    ~/Library/Application Support/Adobe/Startup Scripts CS3/Adobe Photoshop If your script is in this main startup folder, it is also executed by all other Adobe Creative Suite 3 applications at startup. If such a script is meant to be executed only by Photoshop CS3, it must include code such as the following: if( BridgeTalk.appName == "photoshop"...
  • Page 10: Containment Hierarchy

    Photoshop CS3 Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Basics 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.
  • Page 11: Layer Classes

    Photoshop CS3 Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Basics class is the root of the Photoshop CS3 object model hierarchy. Scripts must target the Application appropriate application in order to run correctly. See ‘Targeting and Referencing the Application Object’...
  • Page 12: The Containment Hierarchy And The Photoshop Cs3 User Interface

    Photoshop CS3 Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Basics History State Class class is a palette object that keeps track of changes made to a document. Each time History State you apply a change to an image, the new state of that image is added to the palette. These states are accessible from document object and can be used to reset the document to a previous state.
  • Page 13 Photoshop CS3 Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Basics To create this object without Object Name Description using a script: Application The Photoshop CS3 application. Start the Photoshop CS3 application. Document The working object, in which you create layers, In Photoshop CS3, choose channels, actions, and so on.
  • Page 14: Additional Objects

    Adobe Photoshop CS3 JavaScript Scripting ArtLayer Reference or in the Adobe Photoshop CS3 Visual Basic Scripting Reference. One of the properties of this object is ). The value type for that property contains a link to the constant that define the Kind( kind allowed values for the property.
  • Page 15: Creating A Sample Hello World Script

    Photoshop CS3 Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Basics 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 environment is the display of a "Hello World"...
  • Page 16: Creating And Running A Vbscript

    Photoshop CS3 Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Basics 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"...
  • Page 17: Creating And Running A Javascript

    Photoshop CS3 at the beginning of the script. Note: Adobe has created the Extend Script scripting language to augment JavaScript for use with Photoshop CS3. You can use the Extend Script command to target the Photoshop CS3...
  • Page 18 Photoshop CS3 Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Basics Note: Photoshop CS3 also supports JavaScript files that use a extension. 3. Do either of the following: If Photoshop CS3 is already open, choose File > Scripts > Browse, and then navigate to the Presets ●...
  • Page 19: Scripting Photoshop Cs3

    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 AppleScript Scripting Reference ● Adobe Photoshop CS3 Visual Basic Scripting Reference ● Adobe Photoshop CS3 JavaScript Scripting Reference ●...
  • Page 20: Viewing Photoshop Cs3'S Type Library (Vbs)

    To view the VBS object library in Microsoft Word: 1. Start Word, and then choose Tools > Macro > Visual Basic Editor. 2. Choose Tools > References, and then select the Adobe Photoshop CS3 Type Library check box and click OK.
  • Page 21: Creating New Objects In A Script

    Photoshop CS3 Adobe Photoshop CS3 Scripting Guide Scripting Photoshop CS3 … end tell Note: Because you include all commands in the block, there is no need to reference the tell object throughout the script. Application In VBScript, do the following to target the application: Dim appRef Set appRef = CreateObject("Photoshop.Application")
  • Page 22 ‘Viewing Photoshop CS3’s AppleScript Dictionary’ on page To find out which commands can be used with an object, look up the object in the Adobe Photoshop ● CS3 AppleScript Scripting Reference. If an object has valid commands, there will be a “Valid Commands”...
  • Page 23: Setting The Active Object

    For more information, look up the Layers add() object in the Adobe Photoshop CS3 JavaScript Scripting Reference. Layers Setting the Active Object To work on a an object in the Photoshop CS3 application, you must make the object the front-most, or active object.
  • Page 24: Setting The Active Document

    Photoshop CS3 Adobe Photoshop CS3 Scripting Guide Scripting Photoshop CS3 Setting the Active Document The following examples demonstrate how to set the active document. --create 2 documents set docRef to make new document with properties ¬ {width:4 as inches, height:4 as inches} set otherDocRef to make new document with properties ¬...
  • Page 25: Setting The Active Layer

    ‘ to the application object and a document object that contains at least one layer. appRef.ActiveDocument = docRef docRef.ActiveLayer = docRef.Layers(1) Look up the property on the object in the Adobe Photoshop CS3 Visual Basic ActiveLayer Document Scripting Reference, or in the Visual Basic Object Browser. Note: You can also use the name of the layer to indicate which layer to use.
  • Page 26: Opening A Document

    Photoshop CS3 Adobe Photoshop CS3 Scripting Guide Scripting Photoshop CS3 ‘ This example assumes docRef is already the ActiveDocument Dim theChannels theChannels = Array(docRef.Channels(0), docRef.Channels(2)) docRef.ActiveChannels = theChannels Alternatively, select all component channels using the property of the ComponentChannels Document object: appRef.ActiveDocument.ActiveChannels= _...
  • Page 27: Specifying File Formats To Open

    In the Adobe Photoshop CS3 AppleScript Scripting Reference look up the ● Photo CD open options class or the EPS open objects class In the Adobe Photoshop CS3 Visual Basic Scripting Reference, or the Adobe Photoshop CS3 JavaScript ● Scripting Reference, look up the objects. PhotoCDOpenOptions...
  • Page 28 Photoshop CS3 Adobe Photoshop CS3 Scripting Guide Scripting Photoshop CS3 Dim appRef Set appRef = CreateObject("Photoshop.Application") 'Remember unit settings and set to values expected by this script Dim originalRulerUnits originalRulerUnits = appRef.Preferences.RulerUnits appRef.Preferences.RulerUnits = 1 'value of 1 = psPixels...
  • Page 29: Saving A Document

    .eps In the Adobe Photoshop CS3 AppleScript Scripting Reference, look up the class ● EPS save options In the Adobe Photoshop CS3 Visual Basic Scripting Reference or in the Adobe Photoshop CS3 JavaScript ● Scripting Reference look up EPSSaveOptions Save Classes...
  • Page 30: Setting Application Preferences

    = 1 'for PsTypeUnits --> 1 (psPixels) In the Adobe Photoshop CS3 Visual Basic Scripting Reference, or in the Visual Basic Object Browser, look up object to view all of the settings properties you can use. Additionally, look up the...
  • Page 31: Allowing Or Preventing Dialogs

    Application In the Adobe Photoshop CS3 Visual Basic Scripting Reference, or in the Visual Basic Object Browser, look up object property . You’ll see the value type for this property is the...
  • Page 32: Using The Document Object

    In AppleScript, fonts is a separate collection, and does not require a reference to the application object to retrieve it. VBS: ● Set fontsInstalled = AppRef.Fonts ● var fontsInstalled = app.fonts The amount of unused memory available to Adobe Photoshop CS3, using the ● free memory property of the object. (FreeMemory/freeMemory) Application The location of the Preferences folder, using the ●...
  • Page 33 ¬ "OS X 10.4.8 US:Applications:Adobe Photoshop CS3:Samples:Ducky.tif" open duckFile set docRef to current document resize image docRef width 4 height 4 resize canvas docRef width 4 height 4 trim docRef basing trim on top left pixel with top trim ¬...
  • Page 34: Working With Layer Objects

    Photoshop CS3 Adobe Photoshop CS3 Scripting Guide Scripting Photoshop CS3 //save original ruler units, then assign it to inches startRulerUnits = app.preferences.rulerUnits app.preferences.rulerUnits = Units.INCHES //get a reference to the file, and open it var fileRef = new File(app.path + "/samples/ducky.tif") var docRef = app.open(fileRef)
  • Page 35: Creating A Layer Set Object

    Photoshop CS3 Adobe Photoshop CS3 Scripting Guide Scripting Photoshop CS3 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.ActiveDocument.ArtLayers.Add layerObj.Name = "MyBlendLayer"...
  • Page 36: Referencing Artlayer Objects

    Photoshop CS3 Adobe Photoshop CS3 Scripting Guide Scripting Photoshop CS3 end tell Dim appRef Set appRef = CreateObject("Photoshop.Application") 'Make a new document and a first layer in the document appRef.Documents.Add() appRef.ActiveDocument.ArtLayers.Add() ' Get a reference to the first layer in the document Dim layerRef Set layerRef = appRef.ActiveDocument.Layers(1)
  • Page 37: Working With Layer Set Objects

    Photoshop CS3 Adobe Photoshop CS3 Scripting Guide Scripting Photoshop CS3 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...
  • Page 38: Linking Layer Objects

    {name:"L2"} link art layer "L1" of current document with art layer "L2" of ¬ current document Look up the command in the Adobe Photoshop CS3 AppleScript Scripting Reference or in the link Photoshop CS3 AppleScript Dictionary. Set layer1Ref = docRef.ArtLayers.Add() Set layer2Ref = docRef.ArtLayers.Add()
  • Page 39: Using The Text Item Object

    Adobe Photoshop ● Kind/kind TextItem/textItem ArtLayer CS3 Visual Basic Scripting Reference, Adobe Photoshop CS3 JavaScript Scripting Reference, or in the Visual Basic Object Browser and the ExtendScript Object Model Viewer. properties of the class in the Adobe Photoshop CS3 AppleScript ●...
  • Page 40: Adding And Manipulating Text In A Text Item Object

    Photoshop CS3 Adobe Photoshop CS3 Scripting Guide Scripting Photoshop CS3 Determining a Layer’s Kind The following examples use an statement to check whether an existing layer is a text layer. if (kind of layerRef is text layer) then endif If layerRef.Kind = 2 Then '2 indicates psTextLayer End If if (newLayerRef.kind == LayerKind.TEXT)
  • Page 41: Working With Selection Objects

    Document object, and the selection-object In the Adobe Photoshop CS3 Visual Basic Scripting Reference, or in the Visual Basic Object Browser, look ● as a property of the object. Also, look up the as a method of the...
  • Page 42: Stroking The Selection Border

    Photoshop CS3 Adobe Photoshop CS3 Scripting Guide Scripting Photoshop CS3 ➤ The following examples assume that the ruler units have been set to pixels and create a selection 1. Creating a variable to hold a new document that is 500 x 500 pixels in size.
  • Page 43: Inverting Selections

    Photoshop CS3 Adobe Photoshop CS3 Scripting Guide Scripting Photoshop CS3 strokeColor = new solidColor strokeColor.cmyk.cyan = 20 strokeColor.cmyk.magenta = 50 strokeColor.cmyk.yellow = 30 strokeColor.cmyk.black = 0 app.activeDocument.selection.stroke (strokeColor, 2, StrokeLocation.OUTSIDE, ColorBlendMode.VIVIDLIGHT, 75, false) Inverting Selections You can use the command of the...
  • Page 44: Loading And Storing Selections

    Photoshop CS3 Adobe Photoshop CS3 Scripting Guide Scripting Photoshop CS3 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 Set fillColor = CreateObject("Photoshop.SolidColor") fillColor.RGB.Red = 255 fillColor.RGB.Green = 0...
  • Page 45: Photoshop Cs3

    Photoshop CS3 Adobe Photoshop CS3 Scripting Guide Scripting Photoshop CS3 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) var chanRef = docRef.channels.add() chanRef.name = "My Channel" chanRef.kind = ChannelType.SELECTEDAREA docRef.selection.store(docRef.channels["My Channel"], SelectionType.EXTEND)
  • Page 46: Using The Document Info Object

    For information about other types of information (properties) you can associate with a document, look up the following: In the Adobe Photoshop CS3 AppleScript Scripting Reference or in the Photoshop CS3 AppleScript ● Dictionary, look up the properties for the class...
  • Page 47: Using Notifier Objects

    Photoshop CS3 Adobe Photoshop CS3 Scripting Guide Scripting Photoshop CS3 In a script, you can access a object’s history states using the object, which is a Document HistoryStates property of the object. You can use a object to reset a document to a previous...
  • Page 48: Using The Pathitem Object

    Add/add notification for. Many event IDs are listed in an Appendix in the Adobe Photoshop CS3 JavaScript Scripting Reference, Adobe Photoshop CS3 Visual Basic Scripting Reference, and Adobe Photoshop CS3 AppleScript Scripting Reference. Some events also operate on several types of objects, and the...
  • Page 49 Photoshop CS3 Adobe Photoshop CS3 Scripting Guide Scripting Photoshop CS3 --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 units of settings to pixel units set docRef to make new document with properties {height:700, width:500, ¬...
  • Page 50: Working With Color Objects

    Photoshop CS3 Adobe Photoshop CS3 Scripting Guide Scripting Photoshop CS3 ' stroke it so we can see something myPathItem.StrokePath(2) 'for PsToolType --> 2 (psBrush) // create a document to work with var docRef = app.documents.add(5000, 7000, 72, "Simple Line") //line #1--it’s a straight line so the coordinates for anchor, left, and //right //for each point have the same coordinates // First create the array of PathPointInfo objects.
  • Page 51: Getting And Converting Colors

    Photoshop CS3 Adobe Photoshop CS3 Scripting Guide Scripting Photoshop CS3 '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.ForegroundColor = solidColorRef //create a solid color array var solidColorRef = new solidColor() solidColorRef.cmyk.cyan = 20...
  • Page 52: Comparing Colors

    If (someColor.model = 2) Then someColor.cmyk 'someColor.model = 2 indicates psColorModel --> 2 (psRGBModel) End If Look up the following in the Adobe Photoshop CS3 Visual Basic Scripting Reference, or in the Visual Basic Object Browser: as properties of the object ●...
  • Page 53: Working With Filters

    5 Note: In the Adobe Photoshop CS3 Visual Basic Scripting Reference, on in the Visual Basic Object Browser look up the method and other methods of the object whose name ApplyGaussianBlur ArtLayer begins with ‘Apply’...
  • Page 54: Understanding Clipboard Interaction

    Photoshop CS3 Adobe Photoshop CS3 Scripting Guide Scripting Photoshop CS3 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 Understanding Clipboard Interaction...
  • Page 55: Using The Copy Merged Command/Method

    True Look up the method for the objects in the Adobe Photoshop CS3 Visual Copy ArtLayer Selection Basic Scripting Reference, or in the Visual Basic Object Browser docRef.selection.copy(true)
  • Page 56: Unit Values

    Photoshop CS3 Adobe Photoshop CS3 Scripting Guide Scripting Photoshop CS3 A type ruler, which is active when using the type tool. ● You set measurement unit types for the type ruler using the type units (TypeUnits/typeUnits) property. Note: These settings correspond to those found in the Photoshop CS3 preference dialog under Photoshop >...
  • Page 57: Unit Value Usage

    To use this table, do one of the following: Look up the properties of the class in the Adobe Photoshop CS3 AppleScript Scripting Reference, or in the ●...
  • Page 58 For VBScript methods, look up the method in the Methods table of the object in the “Interface” chapter ● of the Adobe Photoshop CS3 Visual Basic Scripting Reference, or use the Visual Basic Object Browser. For JavaScript methods, look up the method in the Methods table of the object in the “Object ●...
  • Page 59: Setting Ruler And Type Units In A Script

    Photoshop CS3 Adobe Photoshop CS3 Scripting Guide Scripting Photoshop CS3 AppleScript VBScript JavaScript (Continued) translate Selection.Translate selection.translate (delta x, delta y) (DeltaX, DeltaY) (deltaX, deltaY) translate boundary Selection.TranslateBoun selection.translateBou (delta x, delta y) dary ndary (DeltaX, DeltaY) (deltaX, deltaY) Setting Ruler and Type Units in a Script The unit type settings of the two Photoshop CS3 rulers control how numbers are interpreted when dealing with properties and parameters that support unit values.
  • Page 60: Advanced Scripting

    Photoshop CS3 Adobe Photoshop CS3 Scripting Guide Scripting Photoshop CS3 Script Name Description Saves layer comps as files. Layer Comps to Files.jsx Saves layer comps as a PDF presentation. Layer Comps to PDF.jsx Saves layer comps as a Web photo gallery.
  • Page 61 Photoshop CS3 Adobe Photoshop CS3 Scripting Guide Scripting Photoshop CS3 Preference Set to What it does rulers inches Uses inches as the unit of measurement for graphics. units pixels Uses pixels as the unit of measurement for text (type). dialog modes...
  • Page 62 Photoshop CS3 Adobe Photoshop CS3 Scripting Guide Scripting Photoshop CS3 set display dialogs to theStartDisplayDialogs end tell 2. In Photoshop CS3, choose Photoshop > Preferences > Units & Rulers to verify that your preferences have been returned to your original settings.
  • Page 63: Applying Color To A Text Item

    Photoshop CS3 Adobe Photoshop CS3 Scripting Guide Scripting Photoshop CS3 4. After viewing the document in Photoshop CS3, close the document without saving it. 5. Name the script and save it. HelloWorldDoc ➤ To work with document preferences: 1. Create the following script.
  • Page 64 3. After viewing the document in Photoshop CS3, close the document without saving it. 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: class ●...
  • Page 65 3. After viewing the document in Photoshop CS3, close the document without saving it. Note: Look up the following classes in the Adobe Photoshop CS3 Visual Basic Scripting Reference, or in the Visual Basic Object Browser to see if you understand how you used them in this script: ●...
  • Page 66: Applying A Wave Filter

    Adobe Photoshop CS3 Scripting Guide Scripting Photoshop CS3 Note: Look up the following classes in the Adobe Photoshop CS3 JavaScript Scripting Reference, or in the ExtendScript Object Model Viewer to see if you understand how you used them in this script: ●...
  • Page 67 Photoshop CS3 Adobe Photoshop CS3 Scripting Guide Scripting Photoshop CS3 indicates the bottom row in the document; that is row whose coordinate ● theDocHeightInPixels is the total number of rows in the document. Note: The value of is the total number of pixels that determine the vertical theDocHeightInPixels dimension of the document.
  • Page 68 3. After viewing the document in Photoshop CS3, close the document without saving it. 4. Save the script. Note: Look up the following classes in the Adobe Photoshop CS3 Visual Basic Scripting Reference, or in the Visual Basic Object Browser to see if you understand how you used them in this script: class ●...
  • Page 69: Applying A Motionblur Filter

    3. After viewing the document in Photoshop CS3, close Photoshop CS3 without saving the document. Note: Look up the following classes in the Adobe Photoshop CS3 JavaScript Scripting Reference, or in the ExtendScript Object Model Viewer to see if you understand how you used them in this script: ●...
  • Page 70 2. Choose Run to run the script. Note: Look up the class in the Adobe Photoshop CS3 AppleScript Scripting Reference, or in the motion blur Photoshop CS3 AppleScript Dictionary to see if you understand how you used it in this script: ➤...
  • Page 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 class method in the Adobe Photoshop CS3 JavaScript ArtLayer applyMotionBlur() Scripting Reference, or in the ExtendScript Object Model Viewer to see if you understand how you used it in this script:...
  • Page 72: Action Manager

    Manager from an AppleScript by executing a JavaScript from AppleScript. See ‘Running JavaScript-based Action Manager code from AppleScript’ on page Installing ScriptListener The ScriptListener plug-in is located in the ..\Adobe Photoshop CS3\Scripting Guide\Utilities folder. ➤ To install the ScriptListener: 1. Select the file and then choose Edit >...
  • Page 73: Action Manager Scripting Objects

    Photoshop CS3 Adobe Photoshop CS3 Scripting Guide Action Manager ➤ To uninstall the ScriptListener: 1. Close Photoshop CS3. 2. Verify that a copy of the file still exists in the ScriptListener.8li ..\Adobe Photoshop folder. CS3\Scripting Guide\Utilities 3. Delete the file from the following location: ScriptListener.8li...
  • Page 74: Using The Action Manager From Javascript

    Photoshop CS3 Adobe Photoshop CS3 Scripting Guide Action Manager On Mac OS, the log files are on the desktop. ● Using the Action Manager from JavaScript The section demonstrates how to use the contents of the log to create your ScriptingListenerJS.log...
  • Page 75: Using The Action Manager From A Vbs Script

    Photoshop CS3 Adobe Photoshop CS3 Scripting Guide Action Manager desc4.putInteger( id20, angle ); var id21 = charIDToTypeID( "Hght" ); desc4.putInteger( id21, height ); var id22 = charIDToTypeID( "Amnt" ); desc7.putInteger( id22, amount ); executeAction( id19, desc4 ,DialogModes.NO); 5. To use a JavaScript to apply the Emboss filter to a document, include the emboss function in the JavaScript and call the function with the desired parameters.
  • Page 76 Photoshop CS3 Adobe Photoshop CS3 Scripting Guide Action Manager DIM id9 id9 = objApp.CharIDToTypeID( "Embs" ) DIM desc4 SET desc4 = CreateObject( "Photoshop.ActionDescriptor" ) DIM id10 id10 = objApp.CharIDToTypeID( "Angl" ) Call desc4.PutInteger( id10, 135 ) DIM id11 id11 = objApp.CharIDToTypeID( "Hght" ) Call desc4.PutInteger( id11, 3 )
  • Page 77 Photoshop CS3 Adobe Photoshop CS3 Scripting Guide Action Manager 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( "Hght" ) Call desc4.PutInteger( id11, height )
  • Page 78: Running Javascript-Based Action Manager Code From Vbscript

    Photoshop CS3 Adobe Photoshop CS3 Scripting Guide Action Manager Running JavaScript-based Action Manager code from VBScript You can also access JavaScript-based Action Manager code from a VBScript using the DoJavaScriptFile method. Use the VBscript object browser for more information on the...
  • Page 79: Using Scriptlistener To Find Event Ids And Class Ids

    // ======================================================= var id14 = charIDToTypeID( "Opn " ); var desc5 = new ActionDescriptor(); var id15 = charIDToTypeID( "null" ); desc5.putPath( id15, new File( "C:\\Program Files\\Adobe\\Adobe Photoshop CS3\\Samples\\Fish.psd" ) ); executeAction( id14, desc5, DialogModes.NO ); 4. The method runs the action from a script, and it needs the event ID to identify which executeAction action to take.
  • Page 80 Photoshop CS3 Adobe Photoshop CS3 Scripting Guide Action Manager 5. You can now use this event ID to set up event notification on Open Document from your scripts. In JavaScript, for example: var eventFile = new File(app.path + "/Presets/Scripts/Event Scripts Only/Welcome.jsx") app.notifiers.add( "Opn ", eventFile)
  • Page 81 Photoshop CS3 Adobe Photoshop CS3 Scripting Guide Action Manager desc9.putEnumerated( id36, id37, id38 ); var id39 = charIDToTypeID( "Clr " ); var desc10 = new ActionDescriptor(); var id40 = charIDToTypeID( "Rd " ); desc10.putDouble( id40, 255.000000 ); var id41 = charIDToTypeID( "Grn " );...
  • Page 82: Index

    7 commands working with 72 conventions 5 Actions palette 72 viewing 19 active objects, setting 23 component channels 11 Adobe Photoshop CS3 object model 10, 31 conditional logic 7 AppleScript constants conventions 5 defined 14 creating 15 finding 14, 19...
  • Page 83 VBScript 9 Also see individual objects running 17 activating 23 support 8 Adobe Photoshop CS3 object model 10 using Action Manager 74 creating in a script 21–23 workflow automation sample 59 hierarchy 10 viewing 19 offset filter object, unit values 58...
  • Page 84 Photoshop CS3 Adobe Photoshop CS3 Scripting Guide Index working with 60 Solid Color classes 51 Preferences object spot color channels 11 defined 12 startup scripts 9 relationship to user interface 13 stroking properties selections 42 conventions 5 text 64 finding 19...
  • Page 85 Photoshop CS3 Adobe Photoshop CS3 Scripting Guide Index...

This manual is also suitable for:

13102498 - photoshop cs3 - macPhotoshop cs3

Table of Contents