Adobe InDesign CS5 Server (7.0) Object Model JS: MetadataPreference

InDesign Server CS5

Class

MetadataPreference

 Metadata preferences. Base Class: Preference

QuickLinks

addEventListener, append, countContainer, createContainerItem, getElements, getProperty, removeEventListener, replace, save, setProperty, toSource, toSpecifier

Hierarchy

Document
Preference
MetadataPreference
Event | EventListener | MutationEvent

Properties

PropertyTypeAccessDescription
authorstring r/wThe author of the document.
copyrightInfoURLstring r/wThe URL of the file that contains the linked copyright statement.
copyrightNoticestring r/wThe text to use as a copyright notice.
copyrightStatusCopyrightStatus:
CopyrightStatus.UNKNOWN
CopyrightStatus.YES
CopyrightStatus.NO
r/wThe copyright status of the document.
creationDateDate readonlyThe creation date of the document.
creatorstring readonlyThe name of the application used to create the document.
descriptionstring r/wThe description of the MetadataPreference.
documentTitlestring r/wThe title of the document.
eventListenersEventListeners readonlyA collection of event listeners.
eventsEvents readonlyA collection of events.
formatstring readonlyThe format of the document.
isValidbool readonlyReturns true if the object specifier resolves to valid objects.
jobNamestring r/wThe job name.
keywords Array of string r/wThe list of keywords associated with the document.
modificationDateDate readonlyThe most recent modification date of the document.
parentDocument readonlyThe parent of the MetadataPreference (a Document).
propertiesObject r/wA property that allows setting of several properties at the same time.
serverURLstring readonlyThe location of the document on the asset management server.

Methods

Instances

EventListener addEventListener (eventType: string, handler: varies[, captures: bool=false])
Adds an event listener.

ParameterTypeDescription
eventTypestringThe event type.
handlerFile
JavaScript Function
The event handler. Can accept: File or JavaScript Function.
capturesboolThis parameter is obsolete. (Optional) (default: false)

void append (from: File[, affectAll: bool=false])
Uses metadata from the specified external file to define any undefined metadata properties in the document.

ParameterTypeDescription
fromFileThe path to the external file that contains the metadata.
affectAllboolIf true, also replaces existing metadata with data from the external file. If false, does not replace existing metadata. Note: Defaults to false. (Optional) (default: false)

number countContainer (namespace: string, path: string)
Counts the number of items in the container.

ParameterTypeDescription
namespacestringThe namespace of the container.
pathstringThe path to the container.

void createContainerItem (namespace: string, path: string[, index: number=0][, container: ContainerType=ContainerType.BAG])
Creates an empty container.

ParameterTypeDescription
namespacestringThe namespace of the container.
pathstringThe path to the container.
indexnumberThe index of the item within the container. Specified values must be 1 or greater. To append the item to the end of the index and allow the next available value to be assigned, use 0. (Optional) (default: 0)
containerContainerType:
ContainerType.BAG
ContainerType.SEQ
ContainerType.ALT
The container type. Note: Required when the new item is the first item added to the container. (Optional) (default: ContainerType.BAG)

Array of MetadataPreference getElements ()
Resolves the object specifier, creating an array of object references.

string getProperty (namespace: string, path: string)
Gets the XMP property value associated with the specified path.

ParameterTypeDescription
namespacestringThe namespace of the property.
pathstringThe specified path.

bool removeEventListener (eventType: string, handler: varies[, captures: bool=false])
Removes the event listener.

ParameterTypeDescription
eventTypestringThe registered event type.
handlerFile
JavaScript Function
The registered event handler. Can accept: File or JavaScript Function.
capturesboolThis parameter is obsolete. (Optional) (default: false)

void replace (using: File[, affectAll: bool=false])
Replaces the current metadata in the document with metadata from the specified file.

ParameterTypeDescription
usingFileThe full path to the file that contains the replacement metadata.
affectAllboolIf true, treats all properties as external. Note: Defaults to false. (Optional) (default: false)

void save (to: File)
Saves the metadata in the document to an external file.

ParameterTypeDescription
toFileThe path to the external file.

void setProperty (namespace: string, path: string, value: string)
Sets the XMP property associated with the specified path.

ParameterTypeDescription
namespacestringThe namespace of the property.
pathstringThe specified path(s).
valuestringThe value to assign to the property. Note: To remove the property, pass an empty string.

string toSource ()
Generates a string which, if executed, will return the MetadataPreference.

string toSpecifier ()
Retrieves the object specifier.

Element of

Document.metadataPreferences

Return

Array of MetadataPreference MetadataPreference.getElements ()

Jongware, 23-Mar-2011 v3.0.3dContents :: Index