Adobe 65048332 Scripting Guide

Adobe 65048332 Manual

Adobe 65048332 manual content summary:

  • Adobe 65048332 | Scripting Guide - Page 1
    ADOBE PHOTOSHOP CS5 SCRIPTING GUIDE
  • Adobe 65048332 | Scripting Guide - Page 2
    Systems Incorporated. All rights reserved. Adobe® Creative Suite® 5 Photoshop® Scripting Guide Adobe, the Adobe logo, Illustrator, and Photoshop are either registered trademarks or trademarks of Adobe Systems Inc. in the United States and/or other countries. Apple and Mac OS are trademarks of Apple
  • Adobe 65048332 | Scripting Guide - Page 3
    Contents 1 Introduction 6 About this Manual 6 Conventions in this Guide 6 2 Photoshop Scripting Basics 8 Scripting Overview 8 Why use scripts instead of actions 8 Scripting Support in Photoshop 9 JavaScript support 9 Executing other scripts 10 Startup scripts 10 Executing JavaScripts from
  • Adobe 65048332 | Scripting Guide - Page 4
    28 Specifying file formats to open 29 Saving a Document 31 Setting Application Preferences 32 Allowing or Preventing Dialogs 33 Working with the Photoshop Object Model 33 Using the Application object 34 Using the Document object 34 Manipulating a document object 35 Working with layer objects
  • Adobe 65048332 | Scripting Guide - Page 5
    Contents 5 AppleScript unit considerations 56 Using unit values in calculations 57 Unit value usage 57 Setting ruler and type units in a script 59 Sample Workflow Automation JavaScripts 60 Advanced Scripting 60 Working with document preferences 61 Applying color to a text item 64 Applying
  • Adobe 65048332 | Scripting Guide - Page 6
    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. Chapter
  • Adobe 65048332 | Scripting Guide - Page 7
    CHAPTER 1: Introduction Conventions in this Guide 7 In this case, display dialogs refers to the AppleScript property, DisplayDialogs refers to the VBScript property and displayDialogs refers to the JavaScript property. For larger
  • Adobe 65048332 | Scripting Guide - Page 8
    guide. ➤ For examples of scripts created specifically for use with Photoshop, see Chapter 3, "Scripting Photoshop" on page 21. ➤ For detailed information on Photoshop objects and commands, please use the reference information in the three reference manuals provided with this installation: Adobe
  • Adobe 65048332 | Scripting Guide - Page 9
    you are using, you could target both Photoshop and another Adobe Creative Suite 5 Application, such as Adobe Illustrator® CS5, in the same script. ➤ . NOTE: See Photoshop Help for more information on Photoshop Actions. Scripting Support in Photoshop Photoshop supports scripting in three scripting
  • Adobe 65048332 | Scripting Guide - Page 10
    folder for user-defined scripts is: C:\Program Files\Common Files\Adobe\Startup Scripts CS5\Adobe Photoshop ➤ On Mac OS, the startup folder for user-defined scripts is: ~/Library/Application Support/Adobe/Startup Scripts CS5/Adobe Photoshop If your script is in this main startup folder, it is
  • Adobe 65048332 | Scripting Guide - Page 11
    application) through a scripting language. For additional information about Adobe object models and the scripting languages that support them, see Introduction to Scripting. The Photoshop DOM consists of a hierarchical representation of the Photoshop application, the documents used in it, and the
  • Adobe 65048332 | Scripting Guide - Page 12
    more information on using document objects, see "Creating New Objects in a Script" on page 23 and "Using the Document object" on page 34. Layer classes Photoshop has two types of layers: an Art Layer that can contain image contents and a Layer Set that can contain zero or more art layers. An
  • Adobe 65048332 | Scripting Guide - Page 13
    at once. These kinds of channels are related to the document mode and are called component channels. In addition to the component channels, Photoshop lets you to create additional channels. You can create a spot color channel, a masked area channel, and a selected area channel. Using the commands or
  • Adobe 65048332 | Scripting Guide - Page 14
    Tool. Measurement Scale class The Measurement Scale object provides scripting support for the new Measurement Scale feature that allows you to set a scale for your document. The containment hierarchy and the Photoshop user interface The following table provides describes how each object relates
  • Adobe 65048332 | Scripting Guide - Page 15
    script what to do next. Choose File > Scripts > Script Events Manager. Preferences The application preference settings. Choose Edit > Preferences in Windows, or Photoshop > Preferences in Mac OS. History State Stores a version of the document in the state the document was in each time you saved
  • Adobe 65048332 | Scripting Guide - Page 16
    about using comments, see Introduction to Scripting. For example, look up the art ArtLayer object in either the Adobe Photoshop CS5 JavaScript Scripting Reference or in the Adobe Photoshop CS5 Visual Basic Scripting Reference. One of the properties of this object is Kind( kind). The value type
  • Adobe 65048332 | Scripting Guide - Page 17
    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 specific path in the containment hierarchy, as illustrated below. Application Document Art Layer Text Item
  • Adobe 65048332 | Scripting Guide - Page 18
    are comments. Entering the comments is optional. -- 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
  • Adobe 65048332 | Scripting Guide - Page 19
    run a JavaScript that displays the text Hello World! in a Photoshop document. 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. NOTE: Adobe has created the Extend Script scripting language to
  • Adobe 65048332 | Scripting Guide - Page 20
    .jsx file name extension in the Presets/Scripts folder in your Adobe Photoshop CS5 directory. NOTE: You must place your JavaScripts in the the application. NOTE: Photoshop also supports JavaScript files that use a .js extension. 3. Do either of the following: ➣ If Photoshop is already open, choose
  • Adobe 65048332 | Scripting Guide - Page 21
    these instructions will help you quickly understand how to script Photoshop. Viewing Photoshop Objects, Commands, and Methods The Photoshop reference material for each of the three scripting languages is found in the reference manuals provided in this installation: ➤ Adobe Photoshop CS5 AppleScript
  • Adobe 65048332 | Scripting Guide - Page 22
    Basic. 2. Select View > Object Browser. 3. In the Browse drop-down box, select Edit Custom Component Set. 4. On the COM tab, find "Adobe Photoshop CS5 Object Library". Select it. 5. Click Add. The selected library appears in the "Selected Projects and Components" portion of the window. 6. Click OK
  • Adobe 65048332 | Scripting Guide - Page 23
    enclosing your script in the following statements: tell application "Adobe Photoshop CS5" ... end tell NOTE: Because you include all samples throughout this guide do not reference the Application object. Creating New Objects in a Script To create a new document in the Photoshop application, you
  • Adobe 65048332 | Scripting Guide - Page 24
    's AppleScript dictionary" on page 21. ➤ 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" list at the end of the object description. VBS In
  • Adobe 65048332 | Scripting Guide - Page 25
    which are created with the Add method on either the ArtLayers or LayerSets collections. For more information, look up the Layers object in the Adobe Photoshop CS5 Visual Basic Scripting Reference. JS In JavaScript, you can use the add() method only with the collection name. The add() method is not
  • Adobe 65048332 | Scripting Guide - Page 26
    of the document; a document is the parent of a layer, selection, or channel. For example, if you look at the Application object in the Adobe Photoshop CS5 JavaScript Scripting Reference, or in the ExtendScript Object Model Viewer, you find one of its properties is activeDocument; if you look at the
  • Adobe 65048332 | Scripting Guide - Page 27
    at least one layer. appRef.ActiveDocument = docRef docRef.ActiveLayer = docRef.Layers(1) Look up the ActiveLayer property on the Document object in the Adobe Photoshop CS5 Visual Basic Scripting Reference, or in the Visual Basic Object Browser. NOTE: You can also use the name of the layer to
  • Adobe 65048332 | Scripting Guide - Page 28
    the document name (that is, the path to the file that contains the document) with the command. Opening a file with default file format Because Photoshop supports many different file formats, the open/Open/open() command lets you specify the format of the document you are opening. If you do not
  • Adobe 65048332 | Scripting Guide - Page 29
    CS5 Visual Basic Scripting Reference, or the Adobe Photoshop CS5 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
  • Adobe 65048332 | Scripting Guide - Page 30
    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" with timeout of 300 seconds open myFilePath as PDF with options ¬ {class:PDF open options, ¬ mode:RGB, resolution:72, use antialias:true, page
  • Adobe 65048332 | Scripting Guide - Page 31
    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 Save Options Photoshop BMP GIF EPS JPEG PDF Pict File Pict Resource Pixar PNG TIFF Raw DSC1
  • Adobe 65048332 | Scripting Guide - Page 32
    guide-grid-slice settings, and so on. NOTE: The properties in the settings class/Preferences object correlate to the Photoshop CS5 Preferences dialog options, which you display by choosing Photoshop In the Adobe Photoshop CS5 AppleScript Scripting Reference, or in the Photoshop AppleScript
  • Adobe 65048332 | Scripting Guide - Page 33
    is a property of the Application object, you must reference the Application object in the script to get to the property. In the Adobe Photoshop CS5 Visual Basic Scripting Reference, or in the Visual Basic Object Browser, look up the Application object property DisplayDialogs. You'll see the
  • Adobe 65048332 | Scripting Guide - Page 34
    = app.fonts ➤ The amount of unused memory available to Adobe Photoshop, using the free memory (FreeMemory/freeMemory) property of the Application manual or the object browser of the language you are using. Using the Document object The Document object can represent any open document in Photoshop.
  • Adobe 65048332 | Scripting Guide - Page 35
    " set saveUnit to ruler units of settings set ruler units of settings to inch units set duckFile to alias ¬ "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
  • Adobe 65048332 | Scripting Guide - Page 36
    object model contains two types of layer objects: ➤ ArtLayer objects, which can contain image contents and are basically equivalent to Layers in the Photoshop application. NOTE: An ArtLayer object can also contain text if you use the kind property to set the ArtLayer object's type to text layer
  • Adobe 65048332 | Scripting Guide - Page 37
    The following examples demonstrate how to create an ArtLayer object filled with red at the beginning of 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
  • Adobe 65048332 | Scripting Guide - Page 38
    following examples show how to create a Layer Set object after the creating the first 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
  • Adobe 65048332 | Scripting Guide - Page 39
    object reference names do not remain constant. Refer to an AppleScript language guide or text book for information on referencing a file using either as layer with the same method. Dim appRef, docRef Set appRef = CreateObject("Photoshop.Application") 'Make a new document and a first layer in the
  • Adobe 65048332 | Scripting Guide - Page 40
    CHAPTER 3: Scripting Photoshop Working with the Photoshop Object Model 40 Linking layer objects Scripting also supports linking and unlinking Look up Link in as a method of the ArtLayer object in the Adobe Photoshop CS5 Visual Basic Scripting Reference, or in the Visual Basic Object Browser.
  • Adobe 65048332 | Scripting Guide - Page 41
    , look up the following: ➤ The Kind/kind and TextItem/textItem properties of the ArtLayer object in the Adobe Photoshop CS5 Visual Basic Scripting Reference, Adobe Photoshop CS5 JavaScript Scripting Reference, or in the Visual Basic Object Browser and the ExtendScript Object Model Viewer. ➤ The
  • Adobe 65048332 | Scripting Guide - Page 42
    of the ArtLayer object. To find the properties and methods you can use with a text layer, look up the TextItem object. In the Adobe Photoshop CS5 JavaScript Scripting Reference, or in the ExtendScript Object Model Viewer, look up the textItem property of the ArtLayer object. To find the properties
  • Adobe 65048332 | Scripting Guide - Page 43
    , look up Selection as a property of the Document object. Also, look up the Select as a method of the Selection object. ➤ In the Adobe Photoshop CS5 JavaScript Scripting Reference, or in the ExtendScript Object Model Viewer, look up selection as a property of the Document object. Also, look up the
  • Adobe 65048332 | Scripting Guide - Page 44
    can change the size of a selected area using the expand, contract, and feather commands. The values are passed in the ruler units stored in Photoshop preferences and can be changed by your scripts. If your ruler units are set to pixels, then the following examples will expand, contract, and feather
  • Adobe 65048332 | Scripting Guide - Page 45
    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 fillColor.RGB.Blue = 0 selRef.Fill fillColor, 15, 25, False var fillColor
  • Adobe 65048332 | Scripting Guide - Page 46
    copy, cut and paste selections. Working with Channel objects The Channel object gives you access to much of the available functionality on Photoshop channels. You can create, delete, and duplicate channels or retrieve a channel's histogram and change its kind. See "Creating New Objects in a Script
  • Adobe 65048332 | Scripting Guide - Page 47
    AppleScript Dictionary, look up the properties for the class info-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, look up the properties for
  • Adobe 65048332 | Scripting Guide - Page 48
    to set up 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
  • Adobe 65048332 | Scripting Guide - Page 49
    line. 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 CS5" set ruler units of settings to pixel units set type units of settings to pixel units set docRef to make new document with
  • Adobe 65048332 | Scripting Guide - Page 50
    of PathPointInfo objects. The line has two points, 'so there are two PathPointInfo objects. Set lineArray(0) = CreateObject("Photoshop.PathPointInfo") lineArray(0).Kind = 2 ' for PsPointKind --> 2 (psCornerPoint) lineArray(0).Anchor = Array(100, 100) lineArray(0).LeftDirection = lineArray(0).Anchor
  • Adobe 65048332 | Scripting Guide - Page 51
    myPathItem.strokePath(ToolType.BRUSH) Working with color objects Your scripts can use the same range of colors that are available from the Photoshop user interface. Each color model has its own set of properties. For example, the RGB color (RGBColor/RGBColor) class contains three properties
  • Adobe 65048332 | Scripting Guide - Page 52
    color classes The solid color classes available in Photoshop are illustrated below. Color Classes Solid Color Working with 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,
  • Adobe 65048332 | Scripting Guide - Page 53
    to provides a way to access the cmyk equivalent of the rgb color. var someColor = foregroundColor.cmyk Look up the following in the Adobe Photoshop CS5 JavaScript Scripting Reference, or in the ExtendScript Object Model Viewer: ➤ cmyk as a property of the SolidColor object ➤ foregroundColor as
  • Adobe 65048332 | Scripting Guide - Page 54
    method and other methods of the ArtLayer object whose name begins with "Apply." JS docRef.activeLayer.applyGaussianBlur(5) NOTE: In the Adobe Photoshop CS5 JavaScript Scripting Reference, or in the ExtendScript Object Model Viewer look up the applyGaussianBlur() method and other methods of the
  • Adobe 65048332 | Scripting Guide - Page 55
    docRef copy merged selection of docRef VBS docRef.Selection.Copy True Look up the Copy method for the ArtLayer and Selection objects in the Adobe Photoshop CS5 Visual Basic Scripting Reference, or in the Visual Basic Object Browser JS docRef.selection.copy(true) Look up the copy() method for
  • Adobe 65048332 | Scripting Guide - Page 56
    Help for information about available unit value types. Special unit value types The unit values used by Photoshop are length units, representing values of linear measurement. Support is also included for pixel and percent unit values. These two unit value types are not, strictly speaking, length
  • Adobe 65048332 | Scripting Guide - Page 57
    way with a corresponding reference to cm or mm. They are not supported by the AppleScript terminology. Using unit values in calculations To use a coercion error when run set inchValue to pixelValue as inches NOTE: Because Photoshop is a pixel-oriented application you may not always get back the same
  • Adobe 65048332 | Scripting Guide - Page 58
    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. Class/object Document EPS open options PDF open options lens flare open options
  • Adobe 65048332 | Scripting Guide - Page 59
    DeltaY) (deltaX, deltaY) Setting ruler and type units in a script The unit type settings of the two Photoshop rulers control how numbers are interpreted when dealing with properties and parameters that support unit values. Be sure to set the ruler units as needed at the beginning of your scripts
  • Adobe 65048332 | Scripting Guide - Page 60
    The following sample workflow automation JavaScripts are provided with Photoshop and demonstrate various kinds of scripting usage. The Comps to Files.jsx Saves layer comps as files. Layer Comps to PDF.jsx Saves layer comps as a PDF presentation. Layer Comps to WPG.jsx Saves layer comps as a
  • Adobe 65048332 | Scripting Guide - Page 61
    : 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 set theStartRulerUnits to ruler units of
  • Adobe 65048332 | Scripting Guide - Page 62
    of settings to theStartRulerUnits set type units of settings to theStartTypeUnits set display dialogs to theStartDisplayDialogs end tell 2. In Photoshop, choose Photoshop > Preferences > Units & Rulers to verify that your preferences have been returned to your original settings. 3. After viewing the
  • Adobe 65048332 | Scripting Guide - Page 63
    Edit > Preferences > Units & Rulers to verify that your preferences have been returned to your original settings. 3. After viewing the document in Photoshop, close the document without saving it. 4. Name the script HelloWorldDoc and save it. JS To work with document preferences: 1. Create the
  • Adobe 65048332 | Scripting Guide - Page 64
    executes your commands one by one. 3. After viewing the document in Photoshop, close the document without saving it. NOTE: 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
  • Adobe 65048332 | Scripting Guide - Page 65
    executes your commands one by one. 3. After viewing the document in Photoshop, close the document without saving it. NOTE: 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
  • Adobe 65048332 | Scripting Guide - Page 66
    executes your commands one by one. 3. After viewing the document in Photoshop, close Photoshop without saving the document. NOTE: 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
  • Adobe 65048332 | Scripting Guide - Page 67
    defined must be the same as the first so that the area is a closed selection path. NOTE: See "Photoshop Object Model" on page 11 for information on selection objects and other Photoshop objects. The array values in order are: ➤ Upper left corner of the selection: 0,0 ➣ 0 indicates the left-most
  • Adobe 65048332 | Scripting Guide - Page 68
    document without saving it. 4. Save the script in the Script Editor. NOTE: 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: ➤ wave filter class ➤ art layer
  • Adobe 65048332 | Scripting Guide - Page 69
    the file name in Windows Explorer to run the script. 3. After viewing the document in Photoshop, close the document without saving it. 4. Save the script. NOTE: Look up the following classes in the Adobe Photoshop CS5 Visual Basic Scripting Reference, or in the Visual Basic Object Browser to see if
  • Adobe 65048332 | Scripting Guide - Page 70
    from the Scripts menu (choose File > Script > HelloWorldDoc). 3. After viewing the document in Photoshop, close Photoshop without saving the document. NOTE: Look up the following classes in the Adobe Photoshop CS5 JavaScript Scripting Reference, or in the ExtendScript Object Model Viewer to see if
  • Adobe 65048332 | Scripting Guide - Page 71
    .Selection.Deselect 2. Double click on the file in Windows Explorer to run the script. NOTE: Look up the ArtLayer class: ApplyMotionBlur method in the Adobe Photoshop CS5 Visual Basic Scripting Reference, or in the Visual Basic Object Browser to see if you understand how you used it in this script:
  • Adobe 65048332 | Scripting Guide - Page 72
    and select the script from the Scripts menu (choose File > Script > HelloWorldDoc). NOTE: Look up the ArtLayer class applyMotionBlur() method in the Adobe Photoshop CS5 JavaScript Scripting Reference, or in the ExtendScript Object Model Viewer to see if you understand how you used it in this script.
  • Adobe 65048332 | Scripting Guide - Page 73
    JavaScript-based Action Manager code from AppleScript" on page 80. Installing ScriptListener The ScriptListener plug-in is located in the ..\Adobe Photoshop CS5\Scripting\Utilities folder. To install the ScriptListener: 1. Select the file ScriptListener.8li and then choose Edit > Copy. 2. Paste the
  • Adobe 65048332 | Scripting Guide - Page 74
    the ..\Adobe Photoshop CS5\ Scripting\Utilities folder. 3. Delete the file ScriptListener.8li from the following location: ..\Adobe Photoshop CS functionality. For detailed information about these objects, see the appropriate reference manual, or use the object browser for the language you are using.
  • Adobe 65048332 | Scripting Guide - Page 75
    script. Before you begin this section, you need have already recorded an action. The example in this section assumes you have followed the instructions in "Recording a Script using ScriptListener" on page 74. The procedures in this section use the Action Manager to make the Emboss filter available
  • Adobe 65048332 | Scripting Guide - Page 76
    ( id35, amount ); executeAction( id32, desc7,DialogModes.NO ); } 6. Open Photoshop, to apply the emboss filter by selecting File > Scripts > Browse, and action. The example in this section assumes you have followed the instructions in "Recording a Script using ScriptListener" on page 74. The
  • Adobe 65048332 | Scripting Guide - Page 77
    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") REM Use dialog mode 3 for show no dialogs DIM dialogMode dialogMode = 3 DIM id9 id9 = objApp.CharIDToTypeID( "Embs" ) DIM desc4 SET desc4
  • Adobe 65048332 | Scripting Guide - Page 78
    Action Manager from a VBS Script 78 4. Wrap the code in a VBScript function. In the following example, the function name is Emboss. The creation of the Photoshop application object needs to be outside of the function, as we will explain in the next step. DIM objApp SET objApp = CreateObject
  • Adobe 65048332 | Scripting Guide - Page 79
    objApp.ExecuteAction( id9, desc4, dialogMode ) End Function 6. Apply the emboss filter script by double clicking on the file emboss.vbs. This launches Photoshop, opens the file and applies the emboss filter to the file. Running JavaScript-based Action Manager code from VBScript You can also access
  • Adobe 65048332 | Scripting Guide - Page 80
    ( 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 ) ¬ with arguments
  • Adobe 65048332 | Scripting Guide - Page 81
    ( "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 executeAction method runs the action from a script, and
  • Adobe 65048332 | Scripting Guide - Page 82
    CHAPTER 4: Action Manager Using ScriptListener to find event IDs and class IDs 82 var id17 = charIDToTypeID( "Mk " ); var desc6 = new ActionDescriptor(); var id18 = charIDToTypeID( "Nw " ); var desc7 = new ActionDescriptor(); var id19 = charIDToTypeID( "Md " ); var id20 = charIDToTypeID( "RGBM"
  • Adobe 65048332 | Scripting Guide - Page 83
    CHAPTER 4: Action Manager Using ScriptListener to find event IDs and class IDs 83 6. The executeAction method for both of these actions takes an argument whose value is defined as "Mk ". (See id17 and id34.) This is the event ID for the "New" action. This action also needs to know what class to
  • Adobe 65048332 | Scripting Guide - Page 84
    from JavaScript, 75 using from VBScript, 76 actions vs. scripts, 8 working with, 73 Actions palette, 73 active objects, setting, 25 Adobe Photoshop object model, 11, 33 AppleScript conventions, 6 creating, 18 executing JavaScript from, 10 running, 18 unit value considerations, 56 Applescript viewing
  • Adobe 65048332 | Scripting Guide - Page 85
    I images, changing composition, 12 J JavaScript conventions, 6 creating, 19 executing, 10 executing from AppleScript, 10 executing from VBScript, 10 running, 19 support, 10 using Action Manager, 75 workflow automation sample, 60 L layer classes, 12 Layer Comp object defined, 13 relationship to user
  • Adobe 65048332 | Scripting Guide - Page 86
    33 objects Also see individual objects activating, 25 Adobe Photoshop object model, 11 creating in a script, 23 creating, 49 PDF open options object, unit values, 58 Photoshop object model, using, 18 scripting languages example scripts, 17 supported, 9 ScriptListener finding class IDs, 81 finding
  • Adobe 65048332 | Scripting Guide - Page 87
    Index spot color channels, 13 startup scripts, 10 stroking selections, 44 text, 64 styles, applying to layers, 40 Sub Path Item object defined, 14 T text applying color, 64 formatting, 42 layers, 41 stroking, 64 Text Item object creating, 41 defined, 12 formatting text, 42 unit values, 58 working
  • 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
  • 86
  • 87

SCRIPTING GUIDE
ADOBE PHOTOSHOP CS5