Adobe 13102498 Scripting Guide

Adobe 13102498 - Photoshop CS3 - Mac Manual

Adobe 13102498 manual content summary:

  • Adobe 13102498 | Scripting Guide - Page 1
    SCRIPTING GUIDE bc
  • Adobe 13102498 | Scripting Guide - Page 2
    actual organization. Adobe®, the Adobe logo, Illustrator®, and Photoshop® are either registered trademarks or trademarks of Adobe Systems Incorporated license. Except as permitted by any such license, no part of this guide may be reproduced, stored in a retrieval system, or transmitted, in any
  • Adobe 13102498 | 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 13102498 | 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
  • Adobe 13102498 | Scripting Guide - Page 5
    1 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
  • Adobe 13102498 | 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.
  • Adobe 13102498 | Scripting Guide - Page 7
    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. Note: You can also view
  • Adobe 13102498 | Scripting Guide - Page 8
    Guide Photoshop CS3 Photoshop CS3 Scripting Basics 8 ● 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 CS3 and another Adobe Creative Suite 3 Application, such as Illustrator
  • Adobe 13102498 | Scripting Guide - Page 9
    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 is in this main startup folder, it is
  • Adobe 13102498 | 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 13102498 | 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 object model hierarchy. Scripts must target the appropriate application in order to run correctly. See 'Targeting and Referencing the Application Object' on
  • Adobe 13102498 | Scripting Guide - Page 12
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 12 History State Class The Class The Count Item object provides scripting support for the Count Tool. Color Sampler Class The Color Sampler object provides scripting support for the Color Sampler Tool. Measurement
  • Adobe 13102498 | 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 application. Document The working object, in which you create layers,
  • Adobe 13102498 | 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
  • Adobe 13102498 | 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 the containment hierarchy, as illustrated below. Application Document Art
  • Adobe 13102498 | 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 13102498 | 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 13102498 | 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 13102498 | 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 13102498 | Scripting Guide - Page 20
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 20 Viewing Photoshop CS3's Type Library (VBS) You can use the VBA editor in Microsoft Word to display the objects and commands available for VBScript in Photoshop CS3. ➤ To view the VBS object library in Microsoft Word: 1.
  • Adobe 13102498 | 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
  • Adobe 13102498 | Scripting Guide - Page 22
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 22 set docRef to make 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
  • Adobe 13102498 | 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 13102498 | 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
  • Adobe 13102498 | Scripting Guide - Page 25
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 25 Setting the Active Layer The = docRef.layers[0] Look up the activeLayer property on the Document object in the Adobe Photoshop CS3 JavaScript Scripting Reference, or in the ExtendScript Object Model Viewer. Note: You
  • Adobe 13102498 | 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 13102498 | Scripting Guide - Page 27
    shape is not twice as wide as it is tall. AS tell application "Adobe Photoshop CS3" set myFilePath to alias "OS X 10.4.8 US:Users:psauto:Desktop:opal_screen.pdf" with timeout of 300 seconds open myFilePath as PDF with options ¬ {class:PDF open options, height:pixels 100, width:pixels 200, ¬ mode:RGB
  • Adobe 13102498 | Scripting Guide - Page 28
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 28 VBS Dim appRef Set appRef = CreateObject("Photoshop. we want to open var fileRef = new File("/c/pdffiles/myfile.pdf") // Create a PDF option object var pdfOpenOptions = new PDFOpenOptions pdfOpenOptions.antiAlias = true
  • Adobe 13102498 | 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 as a .jpeg file. AS tell application "Adobe Photoshop CS3" make new document set myFile to "OS X 10.4.8 US:Users:psauto:Desktop:Rat.jpg" set
  • Adobe 13102498 | 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 13102498 | 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 13102498 | 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 13102498 | Scripting Guide - Page 33
    CS3" set saveUnit to ruler units of settings set ruler units of settings to inch units set duckFile to alias ¬ "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
  • Adobe 13102498 | Scripting Guide - Page 34
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 34 JS //save original ruler units, then assign it filled 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 13102498 | 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 13102498 | 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 new document and a first layer in the document appRef.Documents.Add() appRef.ActiveDocument.ArtLayers.Add() ' Get a reference to the
  • Adobe 13102498 | 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 13102498 | 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 13102498 | 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 13102498 | 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
  • Adobe 13102498 | Scripting Guide - Page 41
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 41 (psParagraphText/TextType.PARAGRAPHTEXT. ) When can 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 13102498 | Scripting Guide - Page 42
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 42 ➤ The following examples assume that the light opacity 75 ¬ without preserving transparency VBS Set strokeColor = CreateObject ("Photoshop.SolidColor") strokeColor.CMYK.Cyan = 20 strokeColor.CMYK.Magenta = 50 strokeColor
  • Adobe 13102498 | Scripting Guide - Page 43
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 43 JS strokeColor = new solidColor strokeColor. contract, 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 13102498 | 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 13102498 | Scripting Guide - Page 45
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 45 VBS Set chanRef = docRef.Channels.Add chanRef.Name The Channel object gives you access to much of the available functionality on Photoshop CS3 channels. You can create, delete, and duplicate channels or retrieve a
  • Adobe 13102498 | Scripting Guide - Page 46
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 46 AS set kind of myChannel to selected area channel VBS channelRef.ind = 3 'for psSelectedAreaAlphaChannel 'from the constant value PsChannelType JS channelRef.kind = ChannelType.
  • Adobe 13102498 | Scripting Guide - Page 47
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 47 In a script, you can access a Document object Notifier 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 13102498 | 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 13102498 | 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 13102498 | 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) ' Your 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 13102498 | Scripting Guide - Page 51
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 VBS 'create a solidColor array Dim solidColorRef Set solidColorRef = CreateObject("Photoshop. Color Classes The solid color classes available in Photoshop CS3 are illustrated below. Scripting Photoshop CS3 51 Color Classes Solid Color RGB Color
  • Adobe 13102498 | Scripting Guide - Page 52
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 52 AS The following script, which = 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: ● model and
  • Adobe 13102498 | Scripting Guide - Page 53
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 53 AS set myWebSafeColor to web safe color class filter options. VBS appRef.docRef.ActiveLayer.ApplyGaussianBlur 5 Note: In the Adobe Photoshop CS3 Visual Basic Scripting Reference, on in the Visual Basic Object Browser look
  • Adobe 13102498 | Scripting Guide - Page 54
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 54 JavaScript from your script. See ' command 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 13102498 | 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 13102498 | Scripting Guide - Page 56
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 56 ● A type ruler, which is active when Special Unit Value Types The unit values used by Photoshop CS3 are length units, representing values of linear measurement. Support is also included for pixel and percent unit values.
  • Adobe 13102498 | Scripting Guide - Page 57
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 57 When this script is run, cannot be used in this 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 unit value in a calculation
  • Adobe 13102498 | Scripting Guide - Page 58
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 58 Class/Object offset filter Text 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
  • Adobe 13102498 | 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 13102498 | Scripting Guide - Page 60
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 60 Script Name Layer Comps to Files.jsx Layer Comps to PDF.jsx Layer Comps to WPG.jsx Export Layers to Files.jsx Script Events Manager.jsx Image Processor.jsx Load Files into Stack.jsx Merge to
  • Adobe 13102498 | Scripting Guide - Page 61
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 61 Preference rulers units dialog modes and 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 the
  • Adobe 13102498 | 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 > Preferences > Units & Rulers to verify that your preferences have been returned to your original settings. 3. After viewing
  • Adobe 13102498 | 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 have been returned to your original settings. 5. After viewing the document in Photoshop CS3, close the document without saving it. 6. Save the script. Applying
  • Adobe 13102498 | Scripting Guide - Page 64
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 64 AS ➤ To create and specify 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
  • Adobe 13102498 | 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 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
  • Adobe 13102498 | 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 Scripting Reference, or in the ExtendScript Object Model Viewer to see if you understand how you used them in this script: ● SolidColor ● ArtLayer
  • Adobe 13102498 | Scripting Guide - Page 67
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 67 ● theDocHeightInPixels indicates the of generators:1, minimum wavelength:1,¬ maximum wavelength:100, minimum amplitude:5, maximum amplitude:10, ¬ horizontal scale:100, vertical scale:100, wave type:sine,¬ undefined
  • Adobe 13102498 | 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 13102498 | Scripting Guide - Page 69
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 69 JS ➤ To select an area and apply a selRegion) newTextLayer.applyWave(1, 1, 100, 5, 10, 100, 100, WaveType.SINE, UndefinedAreas.WRAPAROUND, 0) 2. Save the script, and then open Photoshop CS3 and select the script from the
  • Adobe 13102498 | Scripting Guide - Page 70
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 70 set theSelRegion to {{theDocWidthInPixels / 2, 0},¬ {theDocWidthInPixels, 0}, ¬ {theDocWidthInPixels, theDocHeightInPixels}, ¬ {theDocWidthInPixels / 2, theDocHeightInPixels}, ¬ {theDocWidthInPixels / 2, 0}} select
  • Adobe 13102498 | 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 13102498 | Scripting Guide - Page 72
    -based Action Manager code from AppleScript' on page 78. 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 ScriptListener.8li and then choose Edit > Copy. 2. Paste the
  • Adobe 13102498 | Scripting Guide - Page 73
    ..\Adobe Photoshop CS3\Scripting Guide\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 13102498 | Scripting Guide - Page 74
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 ● On Mac OS, the log files are on the 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 73. The procedures in this section use the
  • Adobe 13102498 | Scripting Guide - Page 75
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Action Manager 75 desc4.putInteger( id20, angle ); var id21 = charIDToTypeID( " recorded an action. The example in this section assumes you have followed the instructions in 'Recording a Script using ScriptListener' on page 73. The procedures in
  • Adobe 13102498 | 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 13102498 | 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 13102498 | 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 13102498 | Scripting Guide - Page 79
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Action Manager 79 desc7.putInteger( id34, height ); var id35 = charIDToTypeID( opens a document and runs the Emboss filter on it: tell application "Adobe Photoshop CS3" set theFile to alias "Application:Documents:MyFile" open theFile do javascript
  • Adobe 13102498 | Scripting Guide - Page 80
    Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Action Manager 80 5. You can now use and 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 13102498 | 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.
  • Adobe 13102498 | Scripting Guide - Page 82
    JavaScript 74 using from VBScript 75 actions vs. scripts 7 working with 72 Actions palette 72 active objects, setting 23 Adobe Photoshop CS3 object model 10, 31 AppleScript conventions 5 creating 15 executing JavaScript from 9 running 15 unit value considerations 56 Applescript viewing dictionary 19
  • Adobe 13102498 | Scripting Guide - Page 83
    31 objects Also see individual objects activating 23 Adobe Photoshop CS3 object model 10 creating in a script 21-23 hierarchy 10 viewing 19 offset filter object, unit values 58 12 paths, creating 48 PDF open options object, unit values 57 Photoshop CS3 object model 10 preferences setting 30 Index 83
  • Adobe 13102498 | 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 13102498 | 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