EDOBE XDOM TAKE 6 IR - PRODUCTSHEET Especificações Página 260

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 304
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 259
CHAPTER 10: Scripting Access to XMP Metadata Accessing the XMP scripting API 260
Integrating XMPScript with Adobe Bridge
This script adds a command to the context menu for Thumbnails that shows some of the XMP properties.
It demonstrates how to retrieve the XMP metadata that is stored with the Thumbnail object, and use it to
create an XMPMeta object
, then use that object to retrieve different types of property values.
To use this script, place it in the “Startup Scripts” folder for Adobe Bridge (see
Startup scripts” on page 12).
When you start Adobe Bridge, select a thumbnail for a document that contains XMP metadata, right click,
and choose Show XMP Properties from the menu.
$.writeln("XMPFiles batch processing example");
// define folder containing images (make sure that you use copies)
var picFolder = "/c/temp/photos";
// load the XMPScript library
$.writeln("XMPScript Adobe Bridge Integration Example");
// load the XMPScript library
if (ExternalObject.AdobeXMPScript == undefined){
ExternalObject.AdobeXMPScript = new
ExternalObject(’lib:AdobeXMPScript’);
}
// add a context menu item to Thumbnails
var xmpCommand = new MenuElement("command", "Show XMP Properties",
"at the end of Thumbnail", "showProperties");
// define command behavior
xmpCommand.onSelect = function(m) {
// get the first selected thumbnail
thumb = app.document.selections[0];
// if there is one, and it has metadata
if (thumb && thumb.metadata) {
// retrieve metadata from the thumbnail into an XMPMeta object
// (if app.synchronousMode is set, use thumb.metadata)
xmp = new XMPMeta(thumb.synchronousMetadata.serialize());
// retrieve some of the XMP property values
// a simple property with a localized string value
var msg = "Title: " + xmp.getLocalizedText(XMPConst.NS_DC,
"title", null, "en") + "\n";
// an array property
msg += "Authors of the document:\n";
num = xmp.countArrayItems(XMPConst.NS_DC, "creator");
for (i = 1; i <= num; i++)
msg += "* " + xmp.getArrayItem(XMPConst.NS_DC,
"creator", i) + "\n";
// a simple property with a date value
msg += "Creation Date: " + xmp.getProperty(XMPConst.NS_XMP,
"CreateDate")
// display the values
Window.alert(msg);
}
else
Window.alert("No thumbnail selected or no XMP contained");
};
Vista de página 259
1 2 ... 255 256 257 258 259 260 261 262 263 264 265 ... 303 304

Comentários a estes Manuais

Sem comentários