Copy link to clipboard
Copied
I'm trying to get the property Author from linkXmp.
This is how it shows in Links panel.
The result is only "tanleimages".
But the expected result is "tanleimages, Elenamiv/Shutterstock" as it is showing in Links panel (or Bridge, or Photoshop). Why I can't get the correct information using "linkXmp.author"? Any idea? Thanks in advance.
How about this workaround?
var doc = app.activeDocument;
main();
function main() {
var link = doc.links[0],
linkXmp = link.linkXmp,
arr = [],
count = 1,
result;
while (result != "") {
result = linkXmp.getProperty("http://purl.org/dc/elements/1.1/", "creator/*[" + count + "]");
if (result != "") arr.push(result);
count++;
}
}
Copy link to clipboard
Copied
Looks like a bug—same thing happens with the ID documnent info when there is either a comma or semicolon delimiter
$.writeln(app.activeDocument.metadataPreferences.author)
Copy link to clipboard
Copied
Thanks for answering.
Uhmm. So this is a known issue and no solution is provided yet?
Copy link to clipboard
Copied
I couldn't find a bug documented for this so I made one. Please go here and vote for it.
- Mark
Copy link to clipboard
Copied
Have a look at Links panel flyout >> Utilities >> XMP File Info ... >> Raw Data
Is there anything unusual, especially in the photoshop:Credit field? Language attribute, multiple elements?
You could also try the ExtendScript ExternalObject('lib:AdobeXMPScript') instead of the InDesign object.
Haven't looked at it in years since I'm using an own plug-in to access metadata, but that lib should still be around in the default installation.
Copy link to clipboard
Copied
Everything is as usual in File Info window.
In Raw Data, the semicolon separated text are shown as list elements.
I tried some examples I found using ExternalObject library, but no sucess.
Only a weird one, that doesn't fill my gap using something like:
xm.getProperty(XMPConst.NS_DC , "creator/*[1]") and xm.getProperty(XMPConst.NS_DC , "creator/*[2]")
But, since I don't know the number of elements, I can't get the correct result.
It's weird, because the Caption feature in InDesign, returns the full text (as shown in links panel).
Copy link to clipboard
Copied
Copy link to clipboard
Copied
How about this workaround?
var doc = app.activeDocument;
main();
function main() {
var link = doc.links[0],
linkXmp = link.linkXmp,
arr = [],
count = 1,
result;
while (result != "") {
result = linkXmp.getProperty("http://purl.org/dc/elements/1.1/", "creator/*[" + count + "]");
if (result != "") arr.push(result);
count++;
}
}
Copy link to clipboard
Copied
Awesome!!! Thank you so much, @Kasyan Servetsky!