Class SnpModifyMetadata
Object
|
+--SnpModifyMetadata
- class
SnpModifyMetadata
Shows how to acquire and update metadata for a selected thumbnail using XMP external object.
Usage
- In Bridge, select a single thumbnail that has XMP-based metadata, such as a Adobe Photoshop CS5 (PSD), Adobe PDF or Adobe InDesign CS5 (INDD) file.
- Run the snippet in the ExtendScript Toolkit (see Readme.txt)
- Inspect the Metadata panel and the File Properties section; note how the Application has been modified by this snippet.
- Inspect the metadata panel and the IPTC Core section; note how the Title has been modified by this snippet.
- Select File > File Info... > Advanced
- Expand the node http://ns.adobe.bridge.sdk/ and inspect the newly added metadata.
- Inspect the JavaScript console to view information about all modifications made by this snippet to the XMP metadata.
Description
Shows how to acquire XMP metadata for a selected thumbnail and modify the existing data.
Several properties are updated using the XMPMeta object, as well as some custom properties
being added, including arrays, qualifiers and structures. This snippet also demonstrates how to
delete a property, delete all properties from a namespace and delete all properties from the
XMPMeta object.
The selected thumbnail's metadata is collected and serialised to give the XMP packet which
is used to construct a new instance of an XMPMeta object. The XMPMeta object is used to
modify existing metadata as well as add custom data. After all modifications are made
the XMP packet is serialized and written back to the selected thumbnail's metadata property.
To add the custom data a new namespace (http://ns.adobe.bridge.sdk/) and prefix (nssdk) is
registered, the namespace and prefix have no relevance outwith the scope of this snippet. To view
the newly added custom data then use the select File > File Info... > Advanced and expand the
'http://ns.adobe.bridge.sdk/' element.
Note: The selected file will have its metadata over written.
See the JavaScript Tools Guide for more details.
See:
Defined in SnpModifyMetadata.jsx
Field Summary |
String |
requiredContext
The context in which this snippet can run. |
Method Summary |
boolean
|
canRun()
Determines whether snippet can be run given current context.
|
boolean
|
run()
Functional part of this snippet.
|
requiredContext
String requiredContext
The context in which this snippet can run.
SnpModifyMetadata
SnpModifyMetadata()
canRun
boolean canRun()
Determines whether snippet can be run given current context. The snippet
fails if these preconditions are not met:
- Must be running in Bridge
- A selection must be made in the Content pane of Bridge
Returns:
True is this snippet can run, false otherwise
run
boolean run()
Functional part of this snippet. Get the selected Thumbnail and creates an XMPFile object which
is used to get access to the XMP data.
Returns:
True if the snippet ran as expected, false otherwise
http://www.adobe.com/devnet/bridge
Documentation generated by
JSDoc on Tue Apr 27 10:21:34 2010