Skip to main content
Participant
March 13, 2007
質問

Accessing sublevels of CreatorContactInfo

  • March 13, 2007
  • 返信数 1.
  • 1075 ビュー
Hey everyone! I have recently begun Javascripting to import a huge batch of a tab-delimited spreadsheet file filled with metadata to place to thousands of images in Adobe Bridge. Now, here is my barrier:

CreatorContactInfo apparently has sublevels such as:
-CiAdrCtry
-CiEmailWork
-CiUrlWork
etc.

But I'm unable to access those metadata variables. Typically, you would like:
var m = t.metadata;
m.namespace = "http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/";
m.CiAdrCtry = "USA";

I have already followed the bottom of page 114 of the Bridge JavaScript Reference on multivalued properties but that doesn't work for the following:
var m = t.metadata;
m.namespace = "http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/";
var coolVar = m.CreatorContactInfo;
var another = coolVar["CreatorContactInfo/Iptc4xmpCore:CiAdrCity"];

If anyone was able to get around this, please do let me know!

John Vu
このトピックへの返信は締め切られました。

返信数 1

dfranzen_camera_raw
Adobe Employee
Adobe Employee
May 30, 2007
John,

The Bridge CS3 SDK has just been updated to include documentation of XMPScript. XMPScript provies the XMP Toolkit's API in JavaScript. This API for accessing and modifying XMP has previously been available only to C/C++ programmers. It's the tool you want to use to access any "complex" XMP Data types: arrays, structs, lang-alt arrays.

You can get the latest SDK here:
http://www.adobe.com/devnet/bridge/

-David Franzen
Adobe Bridge Quality Engineer
May 28, 2009

Dear David,

I think I saw you last summer when I was a Photoshop intern.

I just came by this post again because I'm struggling with this again. I notice your response was extremely unhelpful. However, I did finally find the answer to my question:

md = image.metadata;

md.namespace = "http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/";
var CreatorCity = md.read("http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/", "Iptc4xmpCore:CreatorContactInfo/Iptc4xmpCore:CiAdrCity");

This will extract each of those components!

John Vu