JAVASCRIPT TOOLS GUIDEADOBE® CREATIVE SUITE® 5
CHAPTER 1: Introduction ExtendScript overview 10The samples are located under the ExtendScript SDK root directory:SDKroot/Samples/javascript/ sam
CHAPTER 4: User-Interface Tools Managing control titles 100XTo achieve a column orientation where the title appears above or below the graphic ele
CHAPTER 4: User-Interface Tools Managing control titles 101XUse spacing to override the default number of pixels separating the title from the gra
CHAPTER 4: User-Interface Tools Managing control titles 102XThis example demonstrates using characters and justify to vertically align the colons
CHAPTER 4: User-Interface Tools Localization in ScriptUI objects 103Margins around the title and graphic objectThe margins property specifies the
CHAPTER 4: User-Interface Tools Localization in ScriptUI objects 104standard. In this example, a btnText object contains localized text strings fo
CHAPTER 4: User-Interface Tools ScriptUI object reference 105ScriptUI object referenceScriptUI is a component that works with the ExtendScript Jav
CHAPTER 4: User-Interface Tools ScriptUI class 106compatabilityObject An object whose properties are the names of compatibility modes supported by
CHAPTER 4: User-Interface Tools ScriptUI class 107ScriptUI class functionsevents.createEvent()ScriptUi.events.createEvent (eventType)eventTypeThe
CHAPTER 4: User-Interface Tools Common properties 108Environment objectThis global object is available through the ScriptUI.environment property.
CHAPTER 4: User-Interface Tools Common properties 109childrenx x x x xxxxxxxxx xxxxxxcolumnsxdefaultElementxenabledx x x x xxxxxxxxxxxxxxxxexpande
CHAPTER 1: Introduction ExtendScript overview 11In addition to the basic set of common functions, some applications provide more extensive sets of
CHAPTER 4: User-Interface Tools Window class 110Window classThe Window class defines these static properties and functions. Window instances creat
CHAPTER 4: User-Interface Tools Window class 111Window class functionsAccess these function through the class. For example:Window.alert(“Notificat
CHAPTER 4: User-Interface Tools Window object 112Window objectWindow object constructorThe constructor creates and returns a new Window object, or
CHAPTER 4: User-Interface Tools Window object 113Window object propertiesThe following element properties apply specifically to Window elements:X
CHAPTER 4: User-Interface Tools Window object 114maximizedBoolean When true, the window is expanded.minimizedBoolean When true, the window is mini
CHAPTER 4: User-Interface Tools Window object 115Container propertiesThe following table shows properties that apply to Window objects and contain
CHAPTER 4: User-Interface Tools Window object 116alignmentString, or Array of 2 StringsApplies to child elements of a container. If defined, this
CHAPTER 4: User-Interface Tools Window object 117margins Margins A Margins object describing the number of pixels between the edges of this contai
CHAPTER 4: User-Interface Tools Window object 118Window object functionsThese functions are defined for Window instances, and as indicated for con
CHAPTER 4: User-Interface Tools Window object 119addEventListener() windowObj.addEventListener (eventName, handler[, capturePhase]); eventNameThe
CHAPTER 1: Introduction Scripting for specific applications 12Scripting for specific applicationsOn startup, all Adobe JavaScript-enabled applicat
CHAPTER 4: User-Interface Tools Window object 120findElement() windowOrContainerObj.findElement (name)nameThe name of the element, as specified in
CHAPTER 4: User-Interface Tools Window object 121removeEventListener() windowObj.removeEventListener (eventName, handler[, capturePhase]); eventNa
CHAPTER 4: User-Interface Tools Window object 122Window event-handling callbacksThe following callback functions can be defined to respond to even
CHAPTER 4: User-Interface Tools Control objects 123Control objectsUI elements that belong to windows can be containers or controls. Containers sha
CHAPTER 4: User-Interface Tools Control objects 124Control types and creation parametersThe following keywords can be used in string literals as t
CHAPTER 4: User-Interface Tools Control objects 125dropdownlist DropDownListA drop-down list with zero or more items. Calls the onChange callback
CHAPTER 4: User-Interface Tools Control objects 126edittext (cont’d) enterKeySignalsOnChange: When false (the default), the control signals an onC
CHAPTER 4: User-Interface Tools Control objects 127group GroupA container for other controls. Containers have additional properties that control t
CHAPTER 4: User-Interface Tools Control objects 128image ImageDisplays an icon or image.To add to a window w: w.add (“image” [, bounds, icon, {cre
CHAPTER 4: User-Interface Tools Control objects 129listbox (cont’d) creation_properties: Optional. An object that contains any of the following pr
132The ExtendScript ToolkitThe ExtendScript Toolkit provides an interactive development and testing environment for ExtendScript in all JavaScrip
CHAPTER 4: User-Interface Tools Control objects 130panel (cont’d) creation_properties: Optional. An object that contains the following property: n
CHAPTER 4: User-Interface Tools Control objects 131radiobutton RadioButtonA dual-state control, grouped with other radiobuttons, of which only one
CHAPTER 4: User-Interface Tools Control objects 132scrollbar (cont’d) To add to a window w: w.add (“scrollbar” [, bounds, value, minvalue, maxvalu
CHAPTER 4: User-Interface Tools Control objects 133statictext StaticTextA text field that the user cannot change. To add to a window w: w.add (“st
CHAPTER 4: User-Interface Tools Control objects 134tab (cont’d) creation_properties: Optional. An object that contains the following property: nam
CHAPTER 4: User-Interface Tools Control objects 135Control object propertiesThe following table shows the properties of ScriptUI control elements.
CHAPTER 4: User-Interface Tools Control objects 136alignment (cont’d) For an array value, the first string element defines the horizontal alignmen
CHAPTER 4: User-Interface Tools Control objects 137imageObject A ScriptUIImage object, or the name of an icon resource, or the pathname or File ob
CHAPTER 4: User-Interface Tools Control objects 138location Point A Point object describing the location of the element as an array, [x, y], repr
CHAPTER 4: User-Interface Tools Control objects 139selection (ListBox)Array of ListItemFor a ListBox, an array of ListItem objects for the current
CHAPTER 2: The ExtendScript Toolkit Configuring the Toolkit window 14You can, for example, adjust the relative sizes of the panels by dragging the
CHAPTER 4: User-Interface Tools Control objects 140subitemsArray For ListItem objects only. When the parent is a multi-column ListBox, the ListIte
CHAPTER 4: User-Interface Tools Control objects 141titleLayoutObject For a DropDownList, FlashPlayer, IconButton, Image, or TabbedPanel with a tit
CHAPTER 4: User-Interface Tools Control objects 142Control object functionsThe following table shows the methods defined for each element type, an
CHAPTER 4: User-Interface Tools Control objects 143dispatchEvent() controlObj.dispatchEvent (eventObj)eventObjAn object of the UIEvent base class.
CHAPTER 4: User-Interface Tools Control objects 144List control object functionsThe following table shows the methods defined for list objects onl
CHAPTER 4: User-Interface Tools Control objects 145FlashPlayer control functionsThese functions apply only to controls of type flashplayer. NOTE:
CHAPTER 4: User-Interface Tools Control objects 146invokePlayerFunction()flashPlayerObj.invokePlayerFunction(fnName, [arg1[,...argn]] )fnNameStrin
CHAPTER 4: User-Interface Tools Control objects 147Control event-handling callbacksThe following events are signalled in certain types of controls
CHAPTER 4: User-Interface Tools Control objects 148DrawState objectA helper object that describes an input state at the time of the triggering onD
CHAPTER 4: User-Interface Tools Event handling 149Event handling Several helper classes provide low-level event-handling capabilities.X Event obje
CHAPTER 2: The ExtendScript Toolkit Configuring the Toolkit window 15Document windowsWhen you open scripts or text files, each file appears in its
CHAPTER 4: User-Interface Tools Event handling 150UIEvent object functionsinitUIEvent()eventObj.initUIEvent (eventName, bubble, isCancelable, view
CHAPTER 4: User-Interface Tools Event handling 151KeyboardEvent objectThis type of object is passed to your registered event handler when a keyboa
CHAPTER 4: User-Interface Tools Event handling 152KeyboardEvent object functionsIn addition to the functions defined for UIEvent base class, a key
CHAPTER 4: User-Interface Tools Event handling 153MouseEvent objectThis type of object is passed to your registered event handler when a mouse-inp
CHAPTER 4: User-Interface Tools Event handling 154MouseEvent object functionsIn addition to the functions defined for UIEvent base class, a mouse
CHAPTER 4: User-Interface Tools Graphic customization objects 155Keyboard state objectThis JavaScript object reports the active state of the keybo
CHAPTER 4: User-Interface Tools Graphic customization objects 156ScriptUIGraphics class propertiesThese static properties provide color type const
CHAPTER 4: User-Interface Tools Graphic customization objects 157ScriptUIGraphics object functionsThese functions directly customize the appearanc
CHAPTER 4: User-Interface Tools Graphic customization objects 158drawString()controlObj.graphics.drawString (text, pen, x, y, font)textThe text st
CHAPTER 4: User-Interface Tools Graphic customization objects 159measureString()controlObj.graphics.measureString (text, font[, boundingWidth])tex
CHAPTER 2: The ExtendScript Toolkit Configuring the Toolkit window 16WorkspacesThe Toolkit saves the current layout when you exit, and restores it
CHAPTER 4: User-Interface Tools Graphic customization objects 160newPen() controlObj.graphics.newPen( type, color, lineWidth);type The pen type, o
CHAPTER 4: User-Interface Tools Graphic customization objects 161ScriptUIBrush objectA helper object that encapsulates the qualities of a brush us
CHAPTER 4: User-Interface Tools Graphic customization objects 162ScriptUIImage objectA helper object that encapsulates a set of images that can be
CHAPTER 4: User-Interface Tools Graphic customization objects 163ScriptUIPen objectA helper object that encapsulates the qualities of a pen used t
CHAPTER 4: User-Interface Tools Graphic customization objects 164A custom element's onDraw event handler function is not called when the mous
CHAPTER 4: User-Interface Tools LayoutManager object 165}}function drawButton (drawingState) {...}LayoutManager objectControls the automatic layou
1665Interapplication Communication with ScriptsThe Adobe scripting environment provides an interapplication messaging framework, a way for to sen
CHAPTER 5: Interapplication Communication with Scripts Cross-DOM functions 167Identifying applicationsWhen calling external functions or exchangin
CHAPTER 5: Interapplication Communication with Scripts Cross-DOM functions 168of application-specific functions. Each application determines the e
CHAPTER 5: Interapplication Communication with Scripts Cross-DOM functions 169openAsNew()appspec.openAsNew([options]) optionsOptional. Application
CHAPTER 2: The ExtendScript Toolkit Selecting scripts 17Selecting scriptsYou can open multiple scripts (or text files, including programs in other
CHAPTER 5: Interapplication Communication with Scripts Communicating through messages 170Communicating through messages Adobe Bridge provides an a
CHAPTER 5: Interapplication Communication with Scripts Communicating through messages 171var bt = new BridgeTalk; // send this msg to the Adobe Br
CHAPTER 5: Interapplication Communication with Scripts Communicating through messages 172var targetApp = BridgeTalk.getSpecifier( "bridge-3.0
CHAPTER 5: Interapplication Communication with Scripts Communicating through messages 173To change the default behavior set the BridgeTalk.onRecei
CHAPTER 5: Interapplication Communication with Scripts Communicating through messages 174A response message can be:X The result of an error in pro
CHAPTER 5: Interapplication Communication with Scripts Communicating through messages 175bt.send(); Example: Handling any errorIn this example, th
CHAPTER 5: Interapplication Communication with Scripts Communicating through messages 176}}Example: Setting up a sender to receive multiple respon
CHAPTER 5: Interapplication Communication with Scripts Communicating through messages 177Passing simple typesWhen your message object’s onResult c
CHAPTER 5: Interapplication Communication with Scripts Communicating through messages 178// now you can access the returned arrayfor (i=0; i< a
CHAPTER 5: Interapplication Communication with Scripts Messaging framework API reference 179Messaging framework API referenceThis application prog
CHAPTER 2: The ExtendScript Toolkit The Script Editor 18The favorite script locations that you define are also available to the Find and Replace d
CHAPTER 5: Interapplication Communication with Scripts BridgeTalk class 180BridgeTalk class propertiesThe BridgeTalk class provides these static p
CHAPTER 5: Interapplication Communication with Scripts BridgeTalk class 181BridgeTalk class functionsThe BridgeTalk class provides these static me
CHAPTER 5: Interapplication Communication with Scripts BridgeTalk class 182getSpecifier()BridgeTalk.getSpecifier (appName,[version],[locale])appNa
CHAPTER 5: Interapplication Communication with Scripts BridgeTalk class 183getStatus()BridgeTalk.getStatus (targetSpec)targetSpecOptional, a speci
CHAPTER 5: Interapplication Communication with Scripts BridgeTalk class 184XIf neither version nor locale is supplied, returns base specifiers wit
CHAPTER 5: Interapplication Communication with Scripts BridgeTalk message object 185BridgeTalk message objectThe message object defines the basic
CHAPTER 5: Interapplication Communication with Scripts BridgeTalk message object 186BridgeTalk message object propertiesbodyString The data paylo
CHAPTER 5: Interapplication Communication with Scripts BridgeTalk message object 187BridgeTalk message object callbacksNOTE: The message callbacks
CHAPTER 5: Interapplication Communication with Scripts BridgeTalk message object 188onResultFunction A callback function that the target applicati
CHAPTER 5: Interapplication Communication with Scripts BridgeTalk message object 189BridgeTalk message object functionssend()bridgeTalkObj.send ([
CHAPTER 2: The ExtendScript Toolkit The Script Editor 19XA full-featured text search tool that can search in multiple files; see “Searching in tex
CHAPTER 5: Interapplication Communication with Scripts Messaging error codes 190Messaging error codesThe interapplication messaging protocol defin
CHAPTER 5: Interapplication Communication with Scripts Application and namespace specifiers 191Application and namespace specifiersAll forms of in
CHAPTER 5: Interapplication Communication with Scripts Application and namespace specifiers 192The following are examples of legal specifiers:phot
CHAPTER 5: Interapplication Communication with Scripts Application and namespace specifiers 193Namespace specifiersWhen calling cross-DOM and expo
1946External Communication ToolsExtendScript offers tools for communicating with other computers or the Internet using standard protocols.X The S
CHAPTER 6: External Communication Tools Socket object 195incoming connections and then return immediately. If there is a connection request, the c
CHAPTER 6: External Communication Tools Socket object 196 // poll for a new connection var connection = tcp.poll(); if (connection
CHAPTER 6: External Communication Tools Socket object reference 197Socket object referenceThis section provides details of the object’s properties
CHAPTER 6: External Communication Tools Socket object reference 198listen()socketObj.listen (port [, encoding]);portNumber. The TCP/IP port number
CHAPTER 6: External Communication Tools Socket object reference 199readln()socketObj.readln ();Reads one line of text up to the next line feed. Li
© 2010 Adobe Systems Incorporated. All rights reserved. Adobe® Creative Suite® 5 JavaScript Tools Guide for Windows® and Macintosh®.NOTICE: All inform
CHAPTER 2: The ExtendScript Toolkit The Script Editor 20BookmarksThe Edit > Bookmarks menu allows you to set and clear navigation points in you
2007Integrating External LibrariesYou can extend the JavaScript DOM for an application by writing a C or C++ shared library, compiling it for the
CHAPTER 7: Integrating External Libraries ExternalObject object 201automatically defined, and you can access the properties and methods through an
CHAPTER 7: Integrating External Libraries ExternalObject object 202ExternalObject class propertiesThe ExternalObject class provides these static p
CHAPTER 7: Integrating External Libraries Defining entry points for direct access 203Defining entry points for direct accessA library to be loaded
CHAPTER 7: Integrating External Libraries Defining entry points for direct access 204X string — Must be UTF-8 encoded.The library must define an e
CHAPTER 7: Integrating External Libraries Defining entry points for direct access 205For example, suppose your library defines these two entry poi
CHAPTER 7: Integrating External Libraries Defining entry points for indirect access 206Defining entry points for indirect accessThe C-client objec
CHAPTER 7: Integrating External Libraries Defining entry points for indirect access 207SoServerInterfaceSoServerInterface is a structure of functi
CHAPTER 7: Integrating External Libraries Defining entry points for indirect access 208addClass()ESerror_t addClass (SoHServer hServer, char* name
CHAPTER 7: Integrating External Libraries Defining entry points for indirect access 209addProperties()ESerror_t addProperties (SoHObject hObject,
CHAPTER 2: The ExtendScript Toolkit The Script Editor 21Mouse navigation and selectionYou can use the mouse or special keyboard shortcuts to move
CHAPTER 7: Integrating External Libraries Defining entry points for indirect access 210SoObjectInterfaceWhen you add a JavaScript class with SoSer
CHAPTER 7: Integrating External Libraries Defining entry points for indirect access 211All SoObjectInterface members must be valid function pointe
CHAPTER 7: Integrating External Libraries Defining entry points for indirect access 212call()ESerror_t call (SoHObject hObject, SoCClientName* nam
CHAPTER 7: Integrating External Libraries Defining entry points for indirect access 213Support structuresThese support structures are passed to fu
CHAPTER 7: Integrating External Libraries Defining entry points for indirect access 214TaggedDataThe TaggedData structure is used to communicate d
CHAPTER 7: Integrating External Libraries Defining entry points for indirect access 215typeThe data type tag. One of:X kTypeUndefined: a null valu
2168ExtendScript Tools and FeaturesIn addition to the specific functional modules and development tools, ExtendScript provides these tools and fe
CHAPTER 8: ExtendScript Tools and Features Dollar ($) object 217engineNameString The name of the current JavaScript engine, if set. Read only.erro
CHAPTER 8: ExtendScript Tools and Features Dollar ($) object 218Dollar ($) object functionslocaleString Gets or sets the current locale. The strin
CHAPTER 8: ExtendScript Tools and Features Dollar ($) object 219colorPicker()$.colorPicker (name)Invokes the platform-specific color selection dia
CHAPTER 2: The ExtendScript Toolkit The Script Editor 22The Script Editor supports extended keyboard input via IME (Windows) or TMS (Mac OS). This
CHAPTER 8: ExtendScript Tools and Features Dollar ($) object 220write()$.write (text[, text...]...)Writes the specified text to the JavaScript Con
CHAPTER 8: ExtendScript Tools and Features ExtendScript reflection interface 221ExtendScript reflection interfaceExtendScript provides a reflectio
CHAPTER 8: ExtendScript Tools and Features ExtendScript reflection interface 222ExamplesThis code determines the class name of an object:obj = new
CHAPTER 8: ExtendScript Tools and Features ExtendScript reflection interface 223ReflectionInfo object propertiesargumentsArray of ReflectionInfoFo
CHAPTER 8: ExtendScript Tools and Features Localizing ExtendScript strings 224Localizing ExtendScript stringsLocalization is the process of transl
CHAPTER 8: ExtendScript Tools and Features Localizing ExtendScript strings 225To use automatic translation of localization objects, you must enabl
CHAPTER 8: ExtendScript Tools and Features Localizing ExtendScript strings 2265. If not found, it removes the region identifier (for example, en)
CHAPTER 8: ExtendScript Tools and Features User notification dialogs 227For example:today = {en: "Today is %1/%2",de: "Heute ist de
CHAPTER 8: ExtendScript Tools and Features User notification dialogs 228This figure shows alert dialogs with error icons.Global confirm functionDi
CHAPTER 8: ExtendScript Tools and Features User notification dialogs 229Global prompt functionDisplays a platform-standard dialog containing a sho
CHAPTER 2: The ExtendScript Toolkit The Script Editor 23You can use the flyout menu at the upper right corner of the document window to choose an
CHAPTER 8: ExtendScript Tools and Features Specifying measurement values 230Specifying measurement valuesExtendScript provides the UnitValue objec
CHAPTER 8: ExtendScript Tools and Features Specifying measurement values 231For example, all the following formats are equivalent:myVal = new Unit
CHAPTER 8: ExtendScript Tools and Features Specifying measurement values 232XPercentage values are relative to a total measurement. For example, 1
CHAPTER 8: ExtendScript Tools and Features Preprocessor directives 233XBinary operators (+, -, *, /, %)If one operand is unitValue object and the
CHAPTER 8: ExtendScript Tools and Features Preprocessor directives 234#include fileIncludes a JavaScript source file from another location. Insert
CHAPTER 8: ExtendScript Tools and Features Operator overloading 235Operator overloadingExtendScript allows you to extend or override the behavior
CHAPTER 8: ExtendScript Tools and Features Operator overloading 236You can override the following operators:X The operators > and >= are imp
2379Integrating XML into JavaScriptExtendScript defines the XML object, which allows you to process XML with your JavaScript scripts. This featur
CHAPTER 9: Integrating XML into JavaScript The XML Object 238If an element is empty in the XML, the corresponding property exists and contains an
CHAPTER 9: Integrating XML into JavaScript The XML Object 239Accessing XML attributesAttribute are properties of their parent elements. In ExtendS
CHAPTER 2: The ExtendScript Toolkit The Script Editor 24/*** @@@BUILDINFO@@@ SnpCreateDialog.jsx !Version! Tue Dec 05 2006 08:03:38 GMT-0800*/You
CHAPTER 9: Integrating XML into JavaScript The XML Object 240Modifying XML elements and attributesYou can change an element by assigning a value t
CHAPTER 9: Integrating XML into JavaScript The XML Object 241The result is this XML:<book category="LITERATURE, FANTASY"><title
CHAPTER 9: Integrating XML into JavaScript The XML Object 242XThe result of XML.children() contains 3 elements, the direct child tags <one>
CHAPTER 9: Integrating XML into JavaScript The XML Object 243<book category="COOKING"><title lang="en">The Boston
CHAPTER 9: Integrating XML into JavaScript The XML Object 244XIf you have assigned an element to a namespace, and have not made it the default, yo
CHAPTER 9: Integrating XML into JavaScript The XML Object 245All XML statements and functions that collect XML return the result as an XMLList, wh
CHAPTER 9: Integrating XML into JavaScript XML Object Reference 246XML Object ReferenceThis section provides reference details for the properties
CHAPTER 9: Integrating XML into JavaScript XML Object Reference 247XML class functionsThese static functions are available through the XML class,
CHAPTER 9: Integrating XML into JavaScript XML Object Reference 248XML object functionsaddNamespace()xmlObj.addNamespace (ns);nsA Namespace object
CHAPTER 9: Integrating XML into JavaScript XML Object Reference 249contains()xmlObj.contains (element);elementAn XML object.Reports whether an ele
CHAPTER 2: The ExtendScript Toolkit The Script Editor 25XAll scripts made public by the current target applicationX Folders that you have defined
CHAPTER 9: Integrating XML into JavaScript XML Object Reference 250inScopeNamespaces()xmlObj.inScopeNamespaces ();Retrieves the current list of va
CHAPTER 9: Integrating XML into JavaScript XML Object Reference 251namespace()xmlObj.namespace ();Retrieves the namespace URI of this element.Retu
CHAPTER 9: Integrating XML into JavaScript XML Object Reference 252processingInstructions()xmlObj.processingInstructions ([name]);nameA String, th
CHAPTER 9: Integrating XML into JavaScript XML Object Reference 253setNamespace()xmlObj.setNamespace(ns);nsA Namespace object for a namespace that
CHAPTER 9: Integrating XML into JavaScript XML Object Reference 254Global functionsThese functions are available in the JavaScript global namespac
CHAPTER 9: Integrating XML into JavaScript XML Object Reference 255QName objectThis object encapsulates a fully qualified XML name, the combinatio
CHAPTER 9: Integrating XML into JavaScript XML Object Reference 256Namespace object constructorsThe Namespace constructor takes several forms:new
25710Scripting Access to XMP MetadataXMPScript, the XMP ExtendScript API, offers JavaScript access to the Adobe XMP Core and XMP Files libraries.
CHAPTER 10: Scripting Access to XMP Metadata Accessing the XMP scripting API 258Using the XMP scripting APIThe XMPMeta object is the primary means
CHAPTER 10: Scripting Access to XMP Metadata Accessing the XMP scripting API 259// retrieve propertyprop = xmp.getProperty(XMPConst.NS_XMP, "
CHAPTER 2: The ExtendScript Toolkit The Script Editor 26In a replace operation, you can use the captured regions of a match in the replacement exp
CHAPTER 10: Scripting Access to XMP Metadata Accessing the XMP scripting API 260Integrating XMPScript with Adobe Bridge This script adds a command
CHAPTER 10: Scripting Access to XMP Metadata XMPScript object reference 261XMPScript object referenceThe classes defined for the XMP JavaScript AP
CHAPTER 10: Scripting Access to XMP Metadata XMPScript object reference 262XMPAliasInfo objectThis object is returned by XMPMeta.resolveAlias(). T
CHAPTER 10: Scripting Access to XMP Metadata XMPScript object reference 263Type namespace string constants Constant values for the field-type name
CHAPTER 10: Scripting Access to XMP Metadata XMPScript object reference 264File format numeric constants Constant values for supported file types,
CHAPTER 10: Scripting Access to XMP Metadata XMPScript object reference 265XMPDateTime objectThis class represents a date and time. Times include
CHAPTER 10: Scripting Access to XMP Metadata XMPScript object reference 266XMPDateTime object propertiesAll properties are read-write, and allow y
CHAPTER 10: Scripting Access to XMP Metadata XMPScript object reference 267XMPFile objectThis class corresponds to the Adobe XMP Toolkit's Fi
CHAPTER 10: Scripting Access to XMP Metadata XMPScript object reference 268XMPFile object constructorsnew XMPFile( filePath, format, openFlags)XMP
CHAPTER 10: Scripting Access to XMP Metadata XMPScript object reference 269XMPFile class functionsThis function is available as a static method of
CHAPTER 2: The ExtendScript Toolkit Debugging in the Toolkit 27Debugging in the ToolkitYou can debug the code in the currently active document win
CHAPTER 10: Scripting Access to XMP Metadata XMPScript object reference 270closeFile()XMPFileObj.closeFile(closeFlags)closeFlagsA close-option con
CHAPTER 10: Scripting Access to XMP Metadata XMPScript object reference 271XMPFileInfo objectThis object is returned by XMPFile.getFileInfo(). The
CHAPTER 10: Scripting Access to XMP Metadata XMPScript object reference 272XMPIterator objectCreated by a call to XMPMeta.iterator(). Walks recurs
CHAPTER 10: Scripting Access to XMP Metadata XMPScript object reference 273There is one static property on the class that provides XMP version inf
CHAPTER 10: Scripting Access to XMP Metadata XMPScript object reference 274deleteNamespace()XMPMeta.deleteNamespace (namespaceURI)namespaceURIThe
CHAPTER 10: Scripting Access to XMP Metadata XMPScript object reference 275registerAlias()XMPMeta.registerAlias (aliasNS, aliasProp, actualNS, act
CHAPTER 10: Scripting Access to XMP Metadata XMPScript object reference 276XMPMeta object functionsresolveAlias()XMPMeta.resolveAlias (aliasNS, al
CHAPTER 10: Scripting Access to XMP Metadata XMPScript object reference 277deleteArrayItem()XMPMetaObj.deleteArrayItem(schemaNS, arrayName,itemInd
CHAPTER 10: Scripting Access to XMP Metadata XMPScript object reference 278doesArrayItemExist()XMPMetaObj.doesArrayItemExist(schemaNS, arrayName,
CHAPTER 10: Scripting Access to XMP Metadata XMPScript object reference 279dumpObject()XMPMetaObj.dumpObject ( )Creates and returns a string conta
CHAPTER 2: The ExtendScript Toolkit Debugging in the Toolkit 28executing code, is halted at a breakpoint, or, having executed all scripts, is wait
CHAPTER 10: Scripting Access to XMP Metadata XMPScript object reference 280getProperty()XMPMetaObj.getProperty(schemaNS, propName[, valueType])sch
CHAPTER 10: Scripting Access to XMP Metadata XMPScript object reference 281insertArrayItem()XMPMetaObj.insertArrayItem(schemaNS, arrayName, itemIn
CHAPTER 10: Scripting Access to XMP Metadata XMPScript object reference 282serialize()XMPMetaObj.serialize([options, padding, indent, newline, bas
CHAPTER 10: Scripting Access to XMP Metadata XMPScript object reference 283serializeToArray()XMPMetaObj.serializeToArray([options, padding, indent
CHAPTER 10: Scripting Access to XMP Metadata XMPScript object reference 284setArrayItem()XMPMetaObj.setArrayItem(schemaNS, arrayName, itemIndex, i
CHAPTER 10: Scripting Access to XMP Metadata XMPScript object reference 285setStructField()XMPMetaObj.setStructField(schemaNS, structName, fieldNS
CHAPTER 10: Scripting Access to XMP Metadata XMPScript object reference 286setProperty()XMPMetaObj.setProperty(schemaNS, propName, propValue[, set
CHAPTER 10: Scripting Access to XMP Metadata XMPScript object reference 287XMPPacketInfo objectThis object is returned by XMPFile.getPacketInfo().
CHAPTER 10: Scripting Access to XMP Metadata XMPScript object reference 288XMPUtils objectThis class provides additional utility functions for the
CHAPTER 10: Scripting Access to XMP Metadata XMPScript object reference 289catenateArrayItems()XMPUtils.catenateArrayItems(xmpObj, schemaNS, array
CHAPTER 2: The ExtendScript Toolkit Debugging in the Toolkit 29The console is a JavaScript listener, that expects input text to be JavaScript code
CHAPTER 10: Scripting Access to XMP Metadata XMPScript object reference 290fieldNSThe field namespace URI string.fieldNameThe field name. Must be
CHAPTER 10: Scripting Access to XMP Metadata XMPScript object reference 291qualNameThe qualifier name. Must be a simple XML name.Creates and retur
CHAPTER 10: Scripting Access to XMP Metadata XMPScript object reference 292removeProperties()XMPUtils.removeProperties(xmpObj, schemaNS, propName,
CHAPTER 10: Scripting Access to XMP Metadata XMPScript object reference 293separateArrayItems()XMPUtils.separateArrayItems(xmpObj, schemaNS, array
29411Porting GuideThis chapter briefly describes changes between this release and the previous release of ExtendScript, to aid you in porting app
295IndexAabsolute paths, 40ActionScript, calling foreign functions, 85active engine status, 27addition operator, 235alertsabout, 74creating, 110d
Index 296interapplication, See interapplication communicationoverview, 166TCP connections, 194comparison operators, 233complex data types, passin
Index 297Eediting features, 18EditText objects, 69creating, 125encodingbinary, 43common names, 46specific platform features, 45supported names, 4
Index 298object references, 39, 47, 56Flashcommunicating with, 85control functions, 145examples, 86FlashPlayer objects, 72floating palettes, 63Fo
Index 299LlayoutAutoLayoutManager algorithm, 97automatic, 86, 165custom example, 95default behavior, 87preferred size of elements, 92properties,
3Contents1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CHAPTER 2: The ExtendScript Toolkit Debugging in the Toolkit 30Visual indication of execution statesWhen the execution of a script halts because t
Index 300MouseEvent object, 153multi-column lists, 73NNamespace object, 255namespace specifiersabout, 193accessing cross-DOM functions, 167identi
Index 301platform-independent paths, 39Point object, 77portability of file references, 42porting guide, 294preferenceskeyboard shortcuts, 21savin
Index 302shortcut keys for user-interface elements, 81shortcutsbookmarks, 20configuring, 16dismissing dialogs, 75keyboard list, 21mouse and keybo
Index 303fonts, 161graphic customization objects, 155grouping, 64, 67methods, 142pens, 163placing, 76properties, 135registering listeners, 82remo
Index 304XMPMeta object, 272using, 258XMPProperty object, 287XMPScript, 257API reference, 261constant values, 262integrating with Adobe Bridge, 2
CHAPTER 2: The ExtendScript Toolkit Debugging in the Toolkit 31Setting breakpointsWhen debugging a script, it is often helpful to make it stop at
CHAPTER 2: The ExtendScript Toolkit Debugging in the Toolkit 32condition statement. You can also specify a hit count, which allows you to skip the
CHAPTER 2: The ExtendScript Toolkit Debugging in the Toolkit 33Evaluation in help tipsIf you let your mouse pointer rest over a variable or functi
CHAPTER 2: The ExtendScript Toolkit Debugging in the Toolkit 34You can inspect the contents of an object by clicking its icon. The list expands to
CHAPTER 2: The ExtendScript Toolkit Code profiling for optimization 35Switching between the functions in the call hierarchy allows you to trace ho
CHAPTER 2: The ExtendScript Toolkit Inspecting object models 36When execution halts (at termination, at a breakpoint, or due to a runtime error),
CHAPTER 2: The ExtendScript Toolkit Inspecting object models 37The Object Model Viewer (OMV) comes up as a separate, floating window. The OMV allo
CHAPTER 2: The ExtendScript Toolkit Inspecting object models 38XEach Adobe application defines a dictionary for that application’s Document Object
393File System AccessAdobe ExtendScript defines classes that simplify cross-platform file-system access. These classes are available to all appli
4File error handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CHAPTER 3: File System Access Using File and Folder objects 40Absolute and relative path namesAn absolute path name in URI notation describes the
CHAPTER 3: File System Access Using File and Folder objects 41The home directoryA path name can start with a tilde (~) to indicate the user’s home
CHAPTER 3: File System Access Using File and Folder objects 42a folder C:\C on Windows. A path starting with /c always addresses the drive C:, so
CHAPTER 3: File System Access Using File and Folder objects 43As an example, suppose you use the UNIX machine myServer for data storage. If you se
CHAPTER 3: File System Access File access error messages 44File access error messagesThe following messages can be returned in the error property.
CHAPTER 3: File System Access File- and Folder-supported encoding names 45File- and Folder-supported encoding namesThe following list of names is
CHAPTER 3: File System Access File- and Folder-supported encoding names 46Common encoding namesThe following encoding names are implemented both i
CHAPTER 3: File System Access File object 47Additional Mac OS encoding namesThese names are alias names for encodings that Mac OS might know.TIS-6
CHAPTER 3: File System Access File object 48File class propertiesThis property is available as a static property of the File class. It is not nece
CHAPTER 3: File System Access File object 49File object propertiesThese properties are available for File objects.openDialog()File.openDialog ([pr
5The AutoLayoutManager algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97Automatic
CHAPTER 3: File System Access File object 50encodingString Gets or sets the encoding for subsequent read/write operations. One of the encoding con
CHAPTER 3: File System Access File object 51File object functionsThese functions are available for File objects.relativeURIString The path name fo
CHAPTER 3: File System Access File object 52execute()fileObj.execute ()Opens this file using the appropriate application, as if it had been double
CHAPTER 3: File System Access File object 53openDlg()fileObj.OpenDlg ([prompt][,filter][,multiSelect])promptOptional. A string containing the prom
CHAPTER 3: File System Access File object 54remove()fileObj.remove ()Deletes the file associated with this object from disk, immediately, without
CHAPTER 3: File System Access File object 55seek()fileObj.seek (pos[, mode])posThe new current position in the file as an offset in bytes from the
CHAPTER 3: File System Access Folder object 56Folder objectRepresents a file-system folder or directory in a platform-independent manner. All prop
CHAPTER 3: File System Access Folder object 57desktopFolder A Folder object for the folder that contains the user’s desktop. Read only.X In Window
CHAPTER 3: File System Access Folder object 58Folder class functionsThese functions are available as a static methods of the Folder class. It is n
CHAPTER 3: File System Access Folder object 59Folder object propertiesThese properties are available for Folder objects.Folder object functionsThe
6AutoLayoutManager object functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1655 Interappli
CHAPTER 3: File System Access Folder object 60create()folderObj.create ()Creates a folder at the location given by this object’s path property. Re
CHAPTER 3: File System Access Folder object 61rename()folderObj.rename (newName)newNameThe new folder name, with no path.Renames the associated fo
624User-Interface ToolsAdobe provides the ScriptUI component, which works with the ExtendScript JavaScript interpreter to provide JavaScript scri
CHAPTER 4: User-Interface Tools ScriptUI programming model 63ScriptUI programming modelScriptUI defines Window objects that represent platform-spe
CHAPTER 4: User-Interface Tools ScriptUI programming model 64Container elements All Windows are containers—that is, they contain other elements wi
CHAPTER 4: User-Interface Tools ScriptUI programming model 65The following examples show equivalent ways of changing an existing window’s width an
CHAPTER 4: User-Interface Tools ScriptUI programming model 66The order of optional parameters must be maintained. Use the value undefined for a pa
CHAPTER 4: User-Interface Tools Types of controls 67If you use a creation property to assign a name to a newly created element, you can access tha
CHAPTER 4: User-Interface Tools Types of controls 68User-interface controlsThese are types of Control objects that are contained in windows, panel
CHAPTER 4: User-Interface Tools Types of controls 69ImageDisplays an iconic image.X The image property identifies the icon image; see “Displaying
7Defining entry points for indirect access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CHAPTER 4: User-Interface Tools Types of controls 70CheckboxAllows the user to set a boolean state.X Set the text property to assign an identifyin
CHAPTER 4: User-Interface Tools Types of controls 71ScrollbarLike a slider, the scrollbar is a bar with a draggable indicator. It also has “steppe
CHAPTER 4: User-Interface Tools Types of controls 72Displaying imagesYou can display icon images in Image or IconButton controls, or display image
CHAPTER 4: User-Interface Tools Types of controls 73If a script does not explicitly set the preferredSize or size property of an element that disp
CHAPTER 4: User-Interface Tools Types of controls 74Notice that the columns have headers, and the label in the second column of the second row has
CHAPTER 4: User-Interface Tools Types of controls 75closed. If the function returns true, the window is closed, but if it returns false, the close
CHAPTER 4: User-Interface Tools Size and location objects 76a button whose name or text value is "cancel" (disregarding case). Because i
CHAPTER 4: User-Interface Tools Drawing objects 77Drawing objectsScriptUI allows you to draw directly on controls to customize their appearance. Y
CHAPTER 4: User-Interface Tools Resource specifications 78For details of these objects, see “Graphic customization objects” on page 155.The Script
CHAPTER 4: User-Interface Tools Resource specifications 79testBtn: Button { text: ’Test’ } The following resource string specifies a panel that co
8XMPScript object reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CHAPTER 4: User-Interface Tools Defining behavior with event callbacks and listeners 80The Build button event handler builds a resource string fro
CHAPTER 4: User-Interface Tools Defining behavior with event callbacks and listeners 81XButton, RadioButton, and Checkbox controls generate events
CHAPTER 4: User-Interface Tools Defining behavior with event callbacks and listeners 82Simulating user eventsYou can simulate user actions by send
CHAPTER 4: User-Interface Tools Defining behavior with event callbacks and listeners 83myButton.addEventListener( ’click’, myFunction );XA locally
CHAPTER 4: User-Interface Tools Defining behavior with event callbacks and listeners 84The ScriptUI implementation of W3C mouse events follows the
CHAPTER 4: User-Interface Tools Communicating with the Flash application 85the bubbling phase. For example, the following click handler, registere
CHAPTER 4: User-Interface Tools Automatic layout 86You do not need to register the ExtendScript function in the ActionScript environment. Your Act
CHAPTER 4: User-Interface Tools Automatic layout 87The script programmer has considerable control over the automatic layout process. Each containe
CHAPTER 4: User-Interface Tools Automatic layout 88et: EditText { characters:4, justify:’right’ } \}");w.show(); Each example shows the effec
CHAPTER 4: User-Interface Tools Automatic layout 89If you set the alignment value using a constant and then query the property, it returns an inde
91IntroductionJavaScript is a platform-independent scripting language that you can use to control many features and automate many tasks in Adobe®
CHAPTER 4: User-Interface Tools Automatic layout 90You can override the container’s child alignment, as specified by alignChildren, by setting the
CHAPTER 4: User-Interface Tools Automatic layout 91Setting marginsThe margins property of a container specifies the number of pixels between the e
CHAPTER 4: User-Interface Tools Automatic layout 92Determining a preferred sizeEach element has a preferredSize property, which is initially defin
CHAPTER 4: User-Interface Tools Automatic layout 93info: Panel { orientation: ’column’, \text: ’Personal Info’, \name: Group { orientation: ’row’,
CHAPTER 4: User-Interface Tools Automatic layout 94} \}, \workInfo: Panel { orientation: ’column’, \text: ’Work Info’, \name: Group { orientation:
CHAPTER 4: User-Interface Tools Automatic layout 95res ="dialog { \whichInfo: DropDownList { alignment:’left’ }, \allGroups: Panel { orientat
CHAPTER 4: User-Interface Tools Automatic layout 96/* Define a custom layout manager that arranges the children** of ’container’ in a stair-step f
CHAPTER 4: User-Interface Tools Automatic layout 97// Create window using resource specwin = new Window (res);// Create list items, select first o
CHAPTER 4: User-Interface Tools Managing control titles 985. Determine the column, row, or stack dimensions, based on the dimensions of the childr
CHAPTER 4: User-Interface Tools Managing control titles 99XThe title property is a String that defines a text label for a UI element. The title ca
Commentaires sur ces manuels