Adobe 65048332 Manual
Adobe 65048332 Manual

Adobe 65048332 Manual

Scripting guide
Table of Contents

Advertisement

ADOBE PHOTOSHOP CS5
SCRIPTING GUIDE

Advertisement

Table of Contents
loading

Summary of Contents for Adobe 65048332

  • Page 1 ADOBE PHOTOSHOP CS5 SCRIPTING GUIDE...
  • Page 2 The information in this document is furnished for informational use only, is subject to change without notice, and should not be construed as a commitment by Adobe Systems Inc. Adobe Systems Inc. assumes no responsibility or liability for any errors or inaccuracies that may appear in this document. The software described in this document is furnished under license and may only be used or copied in accordance with the terms of such license.
  • Page 3: Table Of Contents

    Contents Introduction ............. . 6 About this Manual .
  • Page 4 Contents Setting the active layer ............. . 27 Setting the active channels .
  • Page 5 Contents AppleScript unit considerations ..........56 Using unit values in calculations .
  • Page 6: Introduction

    Introduction About this Manual This manual provides an introduction to scripting Adobe® Photoshop® CS5 on Mac OS® and Windows®. Chapter 1 covers the basic conventions used in this manual. Chapter 2 covers a brief overview of scripting, how to execute scripts, and the Photoshop object model.
  • Page 7 1: Introduction Conventions in this Guide 7 HAPTER In this case, refers to the AppleScript property, refers to the VBScript display dialogs DisplayDialogs property and refers to the JavaScript property. displayDialogs For larger blocks of code, scripting examples are listed on separate lines. layer 1 of layer set 1 of current document appRef.ActiveDocument.LayerSets(1).Layers(1) app.activeDocument.layerSets[0].layers[0]...
  • Page 8: Photoshop Scripting Basics

    ➤ For detailed information on Photoshop objects and commands, please use the reference information in the three reference manuals provided with this installation: Adobe Photoshop CS5 AppleScript Scripting Reference, Adobe Photoshop CS5 Visual Basic Scripting Reference, and Adobe Photoshop CS5 JavaScript Scripting Reference.
  • Page 9: Scripting Support In Photoshop

    ” ➤ A single script can perform actions that involve multiple applications. For example, depending on the scripting language you are using, you could target both Photoshop and another Adobe Creative ® Suite 5 Application, such as Adobe Illustrator CS5, in the same script.
  • Page 10: Executing Other Scripts

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

    A document object model (DOM) is an application programming interface (API), which allows you to programmatically access various components of a document (as defined for that application) through a scripting language. For additional information about Adobe object models and the scripting languages that support them, see Introduction to Scripting.
  • Page 12: Application And Document Classes

    2: Photoshop Scripting Basics Photoshop Object Model 12 HAPTER Photoshop containment hierarchy Application (showing key classes only) Document Notifier Preferences Measure- Layer Document History Color Count Channel ment Selection Comp Info State Sampler Item Scale Path Item Art Layer Layer Set Sub Path Text Item Layer Set...
  • Page 13: Layer Comp Class

    2: Photoshop Scripting Basics Photoshop Object Model 13 HAPTER is a class that comprises multiple layers. Think of it as a folder on your desktop. Since folders Layer Set can contain other folders, a layer set is recursive. That is, one layer set may call another layer set in the Object Model hierarchy.
  • Page 14: Path Item, Sub Path Item, And Path Point Classes

    2: Photoshop Scripting Basics Photoshop Object Model 14 HAPTER Path Item, Sub Path Item, and Path Point classes class represents information about a drawing object, such as the outline of a shape, or a Path Item curved line. The class is contained in the class, and provides the actual geometry Sub Path Item Path Item...
  • Page 15 2: Photoshop Scripting Basics Photoshop Object Model 15 HAPTER To create this object without using a Object name Description script Path Item A drawing object, such as the outline of a Choose the path selection or pen tools shape or a straight or curved line and draw a path with the mouse.
  • Page 16: Additional Objects

    Adobe Photoshop CS5 JavaScript Scripting ArtLayer Reference or in the Adobe Photoshop CS5 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 17: Creating A Sample Hello World Script

    2: Photoshop Scripting Basics Creating a sample Hello World script 17 HAPTER Creating a sample Hello World script This section demonstrates a very simple script in each of the three scripting languages for Photoshop. Traditionally, the first thing to accomplish in any programming environment is the display of a "Hello World"...
  • Page 18: Creating And Running An Applescript

    -- Sample script to create a new text item and -- change its contents. --target Photoshop CS5 tell application "Adobe Photoshop CS5" -- Create a new document and art layer. set docRef to make new document with properties ¬ {width:4 as inches, height:2 as inches} set artLayerRef to make new art layer in docRef -- Change the art layer to be a text layer.
  • Page 19: Creating And Running A Vbscript

    Because you will be actually using Photoshop to run your JavaScripts, it is not necessary to include code that opens Photoshop at the beginning of the script. : Adobe has created the Extend Script scripting language to augment JavaScript for use with Photoshop. You can use the Extend Script command...
  • Page 20 // Restore original ruler unit setting app.preferences.rulerUnits = originalUnit 2. Save file as a text file with a file name extension in the Presets/Scripts folder in your Adobe .jsx Photoshop CS5 directory. : You must place your JavaScripts in the Presets/Scripts folder in order to make the scripts accessible from the File >...
  • Page 21: Scripting Photoshop

    1. In Script Editor, choose File > Open Dictionary. Script Editor displays an Open Dictionary dialog. 2. Choose Adobe Photoshop CS5, and then click Open. Script Editor opens Photoshop and then displays the Photoshop dictionary, which lists objects as well as the commands, properties and elements associated with each object.
  • Page 22: Viewing Photoshop'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 Type Library check box and click 3. Choose View > Object Browser.
  • Page 23: Creating New Objects In A Script

    Creating New Objects in a Script 23 HAPTER To target Photoshop in AppleScript, you must enclosing your script in the following statements: tell application "Adobe Photoshop CS5" end tell : Because you include all commands in the block, there is no need to reference the tell object throughout the script.
  • Page 24 “Viewing Photoshop’s AppleScript dictionary” on page ➤ To find out which commands can be used with an object, look up the object in the Adobe Photoshop CS5 AppleScript Scripting Reference. If an object has valid commands, there will be a “Valid Commands”...
  • Page 25: Setting The Active Object

    Setting the Active Object 25 HAPTER If you look up in the object in the Adobe Photoshop CS5 Visual Basic Scripting Reference or in the Document Visual Basic Object Browser, you will see that there is no method for the object. However, the...
  • Page 26: Setting The Active Document

    Document activeLayer activeHistoryState Similarly, if you look at in the Adobe Photoshop CS5 AppleScript Scripting Reference, or in the application Photoshop AppleScript Dictionary, you find it has the property of , and so on. current For sample scripts that set active objects, see the following sections.
  • Page 27: Setting The Active Layer

    = docRef docRef.ActiveLayer = docRef.Layers(1) Look up the property on the object in the Adobe Photoshop CS5 Visual Basic ActiveLayer Document Scripting Reference, or in the Visual Basic Object Browser. : You can also use the name of the layer to indicate which layer to use. By default, Photoshop names the layers “Layer 1”, “Layer2”.
  • Page 28: Setting The Active Channels

    3: Scripting Photoshop Opening a Document 28 HAPTER Setting the active channels More than one channel can be active at a time, so the current channels ) property of the object takes an array of channels as a ActiveChannels/activeChannels Document value.
  • Page 29: Specifying File Formats To Open

    Photo CD open options class. EPS open objects ➤ In the Adobe Photoshop CS5 Visual Basic Scripting Reference, or the Adobe Photoshop CS5 JavaScript Scripting Reference, look up the objects. PhotoCDOpenOptions EPSOpenOptions The following examples demonstrate how to open a generic (multi-page/multi-image) PDF document with the following specifications: ➤...
  • Page 30 The document’s original shape will change to conform to the height and width properties if the original shape is not twice as wide as it is tall. tell application "Adobe Photoshop CS5" set myFilePath to alias "OS X 10.5.8 US:Users:psauto:Desktop:opal_screen.pdf"...
  • Page 31: Saving A Document

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

    = 1 'for PsTypeUnits --> 1 (psPixels) In the Adobe Photoshop CS5 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 33: Allowing Or Preventing Dialogs

    Application In the Adobe Photoshop CS5 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 34: Using The Application Object

    ➣ VBS: Set fontsInstalled = AppRef.Fonts ➣ var fontsInstalled = app.fonts ➤ The amount of unused memory available to Adobe Photoshop, using the free memory property of the object. (FreeMemory/freeMemory) Application ➤ The location of the Preferences folder, using the...
  • Page 35: Manipulating A Document Object

    ¬ "OS X 10.5.8 US:Applications:Adobe Photoshop CS5: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 36: Working With Layer Objects

    3: Scripting Photoshop Working with the Photoshop Object Model 36 HAPTER 'Crop the document with ' angle=45, width=20,height=20 docRef.Crop Array(100,200,400,500),45,20,20 docRef.FlipCanvas 1 ' psHorizontal 'restore ruler units appRef.Preferences.RulerUnits = startRulerUnits //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")
  • Page 37: Creating An Artlayer Object

    The following examples demonstrate how to create an object filled with red at the beginning of ArtLayer the current document. tell application "Adobe Photoshop CS5" make new document make new art layer at beginning of current document ¬ with properties {name:"MyBlendLayer", blend mode:normal} select all current document fill selection of current document with contents ¬...
  • Page 38: Creating A Layer Set Object

    Layer Set ArtLayer object in the current document: tell application "Adobe Photoshop CS5" make new document with properties {name:"My Document"} make new art layer at beginning of current document make new layer set after layer 1 of current document...
  • Page 39: Working With Layer Set Objects

    3: Scripting Photoshop Working with the Photoshop Object Model 39 HAPTER You can use the following syntax to refer to the layers by the names given them by the Application: layer 1 of layer set 1 of current document : Unlike object references in JavaScript or VBScript, AppleScript object reference names do not remain constant.
  • Page 40: 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 CS5 AppleScript Scripting Reference or in the link Photoshop AppleScript Dictionary. Set layer1Ref = docRef.ArtLayers.Add() Set layer2Ref = docRef.ArtLayers.Add()
  • Page 41: Using The Text Item Object

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

    ➤ In the Adobe Photoshop CS5 Visual Basic Scripting Reference, or in the Visual Basic Object Browser look up the property of the object. To find the properties and methods you can use...
  • Page 43: Creating And Defining A Selection

    Document selection-object ➤ In the Adobe Photoshop CS5 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 Selection Document Select object.
  • Page 44: Stroking The Selection Border

    3: Scripting Photoshop Working with the Photoshop Object Model 44 HAPTER var docRef = app.documents.add(500, 500) var shapeRef = [ [0,0], [0,100], [100,100], [100,0] docRef.selection.select(shapeRef) Stroking the selection border The following examples use the command of the object to stroke stroke (Stroke/stroke()) Selection the boundaries around the current selection and set the stroke color and width.
  • Page 45: Filling A Selection

    3: Scripting Photoshop Working with the Photoshop Object Model 45 HAPTER by five pixels. See section “Setting Application Preferences” on page 32 for examples of how to change ruler units. expand selection of current document by pixels 5 contract selection of current document by pixels 5 feather selection of current document by pixels 5 Dim selRef Set selRef = appRef.ActiveDocument.Selection...
  • Page 46: Working With Channel Objects

    3: Scripting Photoshop Working with the Photoshop Object Model 46 HAPTER examples use the command of the object to store the current store (Store/store()) Selection selection in a channel named and extend the selection with any selection that is currently in My Channel that channel.
  • Page 47: 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 CS5 AppleScript Scripting Reference or in the Photoshop AppleScript Dictionary, look up the properties for the class info-object ➤...
  • Page 48: Using Notifier Objects

    Add/add notification for. Many event IDs are listed in an Appendix in the Adobe Photoshop CS5 JavaScript Scripting Reference, Adobe Photoshop CS5 Visual Basic Scripting Reference, and Adobe Photoshop CS5 AppleScript Scripting Reference. Some events also operate on several types of objects, and the...
  • Page 49: Using The Pathitem Object

    : Notification generally does not take effect on events that occur inside of a script, because these events are embedded with in an event. "AdobeScriptAutomation Scripts" tell application "Adobe Photoshop CS5" delete notifiers end try make new notifier with properties {event:"Opn ", ¬...
  • Page 50 3: Scripting Photoshop Working with the Photoshop Object Model 50 HAPTER Dim appRef, docRef Dim lineArray(1), lineArray2(1), lineSubPathArray(0), myPathItem Set appRef = CreateObject("Photoshop.Application") ' create a document to work with Set docRef = appRef.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: Working With Color Objects

    3: Scripting Photoshop Working with color objects 51 HAPTER // Next create a SubPathInfo object, which holds the line array // in its entireSubPath property. var lineSubPathArray = new Array() lineSubPathArray[0] = new SubPathInfo() lineSubPathArray[0].operation = ShapeOperation.SHAPEXOR lineSubPathArray[0].closed = false lineSubPathArray[0].entireSubPath = lineArray //create the path item, using add.
  • Page 52: Solid Color Classes

    CMYK equivalent. convert color get foreground color convert color foreground color to CMYK Look up the following in the Adobe Photoshop CS5 AppleScript Scripting Reference or in the Photoshop AppleScript Dictionary: ➤ In the “Objects” section, the property of the class...
  • Page 53: Comparing Colors

    3: Scripting Photoshop Working with Filters 53 HAPTER Look up the following in the Adobe Photoshop CS5 Visual Basic Scripting Reference, or in the Visual Basic Object Browser: ➤ as properties of the object model cmyk SolidColor This example uses the...
  • Page 54: Other Filters

    5 : In the Adobe Photoshop CS5 Visual Basic Scripting Reference, on in the Visual Basic Object Browser look up the method and other methods of the object whose name begins...
  • Page 55: Using The Copy Merged Command/Method

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

    3: Scripting Photoshop Working with Units 56 HAPTER Working with Units Photoshop provides two rulers for documents. Using properties on the settings-object ) object, you can set the measurement units for the rulers in your script. The Preferences/Preferences rulers are: ➤...
  • Page 57: Using Unit Values In Calculations

    3: Scripting Photoshop Working with Units 57 HAPTER The values returned for a Photoshop property that uses units is returned as a value of the current ruler type. Getting the height of the document created above: set docHeight to height of current document returns a value of 5.0, which represents 5 inches based on the current ruler settings.
  • Page 58 HAPTER To use this table, do one of the following: ➤ Look up the properties of the class in the Adobe Photoshop CS5 AppleScript Scripting Reference, or in the Photoshop AppleScript Dictionary. ➤ Look up the property of the object in the Adobe Photoshop CS5 Visual Basic Scripting Reference, the Adobe Photoshop CS5 JavaScript Scripting Reference, the Visual Basic Object Browser, or the ExtendScript Object Model Viewer.
  • Page 59: Setting Ruler And Type Units In A Script

    3: Scripting Photoshop Working with Units 59 HAPTER AppleScript VBScript JavaScript crop Document.Crop document.crop (bounds, height, width) (Bounds, Height, Width) (bounds, height, width) resize canvas Document.ResizeCanvas document.resizeCanvas (height, width) (Height, Width) (height, width) resize image Document.ResizeImage document.resizeImage (height, width) (Height, Width) (height, width) contract Selection.Contract...
  • Page 60: Sample Workflow Automation Javascripts

    3: Scripting Photoshop Sample Workflow Automation JavaScripts 60 HAPTER Sample Workflow Automation JavaScripts The following sample workflow automation JavaScripts are provided with Photoshop and demonstrate various kinds of scripting usage. The scripts are located in the folder in your application Presets/Scripts directory.
  • Page 61: Working With Document Preferences

    To work with document preferences: 1. Create and run the following script. See “Creating and running an AppleScript” on page 18 for details. tell application "Adobe Photoshop CS5" --make Photoshop CS5 the active (front-most) application activate --create variables for the default settings...
  • Page 62 3: Scripting Photoshop Advanced Scripting 62 HAPTER --check to see whether any documents are open --if none are found, create a document --use the default document settings as its properties if (count of documents) is 0 then make new document with properties ¬ {width:theDocWidthInInches, height:theDocHeightInInches,¬...
  • Page 63 3: Scripting Photoshop Advanced Scripting 63 HAPTER 'restore beginning preferences appRef.Preferences.RulerUnits = startRulerUnits appRef.Preferences.TypeUnits = startTypeUnits appRef.DisplayDialogs = startDisplayDialogs Double click the file name in Windows Explorer to run the script. 2. In Photoshop, choose Edit > Preferences > Units & Rulers to verify that your preferences have been returned to your original settings.
  • Page 64: Applying Color To A Text Item

    3. After viewing the document in Photoshop, close the document without saving it. : Look up the following classes in the Adobe Photoshop CS5 AppleScript Scripting Reference or in the Photoshop AppleScript Dictionary to see if you understand how you used them in this script: ➤...
  • Page 65 3. After viewing the document in Photoshop, close the document without saving it. : Look up the following classes in the Adobe Photoshop CS5 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

    3. After viewing the document in Photoshop, close Photoshop without saving the document. : Look up the following classes in the Adobe Photoshop CS5 JavaScript Scripting Reference, or in the ExtendScript Object Model Viewer to see if you understand how you used them in this script: ➤...
  • Page 67: Defining The Area Of A Selection Object

    3: Scripting Photoshop Advanced Scripting 67 HAPTER ➤ Apply a wave filter to the selection. : The wave is a truncated sine curve. Defining the area of a selection object To define the area of a selection object, we create an array of coordinates, or points specified in pixels within the document.
  • Page 68 4. Save the script in the Script Editor. : Look up the following classes in the Adobe Photoshop CS5 AppleScript Scripting Reference, or in the Photoshop AppleScript Dictionary to see if you understand how you used them in this script: ➤...
  • Page 69 3. After viewing the document in Photoshop, close the document without saving it. 4. Save the script. : Look up the following classes in the Adobe Photoshop CS5 Visual Basic Scripting Reference, or in the Visual Basic Object Browser to see if you understand how you used them in this script: ➤...
  • Page 70 3. After viewing the document in Photoshop, close Photoshop without saving the document. : Look up the following classes in the Adobe Photoshop CS5 JavaScript Scripting Reference, or in the ExtendScript Object Model Viewer to see if you understand how you used them in this script: ➤...
  • Page 71: Applying A Motionblur Filter

    2. Choose Run to run the script. : Look up the class in the Adobe Photoshop CS5 AppleScript Scripting Reference, or in the motion blur Photoshop AppleScript Dictionary to see if you understand how you used it in this script: To apply a motionblur filter to HelloWorldDoc: 1.
  • Page 72 2. Save the script, and then open Photoshop and select the script from the Scripts menu (choose File > Script > HelloWorldDoc). : Look up the class method in the Adobe Photoshop CS5 JavaScript ArtLayer applyMotionBlur() Scripting Reference, or in the ExtendScript Object Model Viewer to see if you understand how you used it in...
  • Page 73: Action Manager

    “Running JavaScript-based Action Manager code from AppleScript” on page Installing ScriptListener The ScriptListener plug-in is located in the folder. ..\Adobe Photoshop CS5\Scripting\Utilities To install the ScriptListener: 1. Select the file and then choose Edit > Copy. ScriptListener.8li 2. Paste the file copy to the following location: ..\Adobe Photoshop CS5\Plug-Ins\Automate...
  • Page 74: Action Manager Scripting Objects

    Action Manager Scripting Objects 74 HAPTER To uninstall the ScriptListener: 1. Close Photoshop. 2. Verify that a copy of the file still exists in the ScriptListener.8li ..\Adobe Photoshop CS5\ folder. Scripting\Utilities 3. Delete the file from the following location: ScriptListener.8li ..\Adobe Photoshop CS\Plug-Ins\Automate 4.
  • Page 75: Using The Action Manager From Javascript

    4: Action Manager Using the Action Manager from JavaScript 75 HAPTER 7. Check for the script log files: ➣ In Windows, the log files are in your desktop. ➣ 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 76: Using The Action Manager From A Vbs Script

    4: Action Manager Using the Action Manager from a VBS Script 76 HAPTER 4. Wrap the code in a JavaScript function. In the following example, the function name is emboss function emboss( angle, height, amount ) var id19 = charIDToTypeID( "Embs" ); var desc4 = new ActionDescriptor();...
  • Page 77 4: Action Manager Using the Action Manager from a VBS Script 77 HAPTER To create a VBScript from the ScriptListener output: 1. Open from the desktop. ScriptingListenerVB.log At the end of the file you will see code similar to the following (although your numbers may be different): DIM objApp SET objApp = CreateObject("Photoshop.Application")
  • Page 78 4: Action Manager Using the Action Manager from a VBS Script 78 HAPTER 4. Wrap the code in a VBScript function. In the following example, the function name is . The Emboss creation of the Photoshop application object needs to be outside of the function, as we will explain in the next step.
  • Page 79: Running Javascript-Based Action Manager Code From Vbscript

    4: Action Manager Running JavaScript-based Action Manager code from VBScript 79 HAPTER Function Emboss( angle, height, amount ) REM Use dialog mode 3 for show no dialogs DIM dialogMode dialogMode = 3 DIM id9 id9 = objApp.CharIDToTypeID( "Embs" ) DIM desc4 SET desc4 = CreateObject( "Photoshop.ActionDescriptor"...
  • Page 80: Running Javascript-Based Action Manager Code From Applescript

    // Call emboss with values provided in the "arguments" collection emboss( arguments[0], arguments[1], arguments[2] ); 3. The following AppleScript code sample opens a document and runs the Emboss filter on it: tell application "Adobe Photoshop CS5" set theFile to alias “Application:Documents:MyFile” open theFile do javascript (file <path to Emboss.jsx>) ¬...
  • Page 81: 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 CS5\\ 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 82 4: Action Manager Using ScriptListener to find event IDs and class IDs 82 HAPTER // ======================================================= var id17 = charIDToTypeID( "Mk " ); var desc6 = new ActionDescriptor(); var id18 = charIDToTypeID( "Nw " ); var desc7 = new ActionDescriptor(); var id19 = charIDToTypeID( "Md "...
  • Page 83 4: Action Manager Using ScriptListener to find event IDs and class IDs 83 HAPTER 6. The method for both of these actions takes an argument whose value is defined as executeAction . (See .) This is the event ID for the “New” action. This action also needs to know "Mk "...
  • Page 84: Index

    Color object working with, 73 in the DOM, 16 Actions palette, 73 Color objects active objects, setting, 25 applying to text, 64 Adobe Photoshop object model, 11, 33 comparing, 53 AppleScript defined, 51 conventions, 6 getting and converting, 52 creating, 18...
  • Page 85 Index using, 47 Document object images, changing composition, 12 activating, 26 adding, 24 defined, 12 document information, 47 JavaScript manipulating, 35 conventions, 6 opening, 28 creating, 19 relationship to user interface, 14 executing, 10 saving, 31 executing from AppleScript, 10 unit values, 58 executing from VBScript, 10 using, 34...
  • Page 86 IDs, 81 objects installing, 73 Also see individual objects log files, 73 activating, 25 recording scripts, 74 Adobe Photoshop object model, 11 uninstalling, 74 creating in a script, 23–25 scripts hierarchy, 11 advanced, 60 viewing, 21 capabilities, 8...
  • Page 87 Index spot color channels, 13 using Action Manager, 76 startup scripts, 10 stroking selections, 44 wave filters, applying, 66–70 text, 64 web safe color, 53 styles, applying to layers, 40 workflow automation, JavaScript, 60 Sub Path Item object defined, 14 text applying color, 64 formatting, 42...

This manual is also suitable for:

65048599Photoshop cs5

Table of Contents