Can't retrieve XMP-metadata from Cloud-stored files
Hello Adobe and hello Community,
I'm having a problem with a Javascript I wrote to retrieve XMP metadata from linked files, that are stored in a Creative Cloud Library (Bought from Adobe Stock -> stored in a Library, because i was unable to download the files).
Ultimately, the script retrieves the Creditline of all the linked graphics in an InDesign-file / InDesign-files in a folder by bulk processing.
I have to accesse the XMP to retrieve the correct copyrightinfo.
@Adobe: On Adobe Stock you guys put the information to give credit to the creator in the XMP field "Creditline" (creator - stock.adobe.com). In InDesign you cannot retrieve that field by out-of-the-box extendscript methods like: Link.linkXmp.copyrightNotice
Please add the method to retrieve the correct field in extendscript!
The Script I'm running works perfectly fine for links, that are located on my local drive or server but it doesn't work for Assets that are linked in the document from Adobe Creative Cloud.
My Script looks something like this:
if ( !ExternalObject.AdobeXMPScript ){
try{ExternalObject.AdobeXMPScript = new ExternalObject('lib:AdobeXMPScript');}
catch (e){alert('Unable to load the AdobeXMPScript library!');}
}
var myFile = File(app.selection[0].graphics[0].itemLink.filePath);
alert(myFile.fsName);
xmpFile = new XMPFile(myFile.fsName, XMPConst.UNKNOWN, XMPConst.OPEN_FOR_READ);
var myXmp = xmpFile.getXMP();
xmpFile.closeFile(XMPConst.CLOSE_UPDATE_SAFELY);
var myPsCredit = myXmp.getProperty(XMPConst.NS_PHOTOSHOP,"Credit");
var myDcCredit = myXmp.getProperty(XMPConst.NS_DC,'rights[1]');
if (myPsCredit) {
var output = myPsCredit;
} else{
var output = myDcCredit;
}
alert(output);
if( ExternalObject.AdobeXMPScript ){
try{ExternalObject.AdobeXMPScript.unload(); ExternalObject.AdobeXMPScript = undefined;}
catch (e){alert('Unable to unload the AdobeXMPScript library!');}
}
In this line I'm getting an error:
errornumber: 1000
errorstring: XMP Exception: OpenFile returned false
xmpFile = new XMPFile(myFile.fsName, XMPConst.UNKNOWN, XMPConst.OPEN_FOR_READ);
I'm reading from this, that the XMP of that file which is located in the Creative Cloud, cannot be opened.
Is there a way for still retrieving the XMP-data from those files?
Unless there is a way to bulk-download all the Assets from the cloud and automatically re-link them in all the files i want to check (which Adobe also does not support. You can only download one file at a time from the Creative Cloud App. Great job, well done, users are sooooo happy about that), I have to access the XMP in the Cloud-stored files.
If there is no other way to access the needed XMP-data, please implement a fix to do so.
Also posted here, but so far I didn't receive an answer: https://community.adobe.com/t5/indesign/retrieving-xmp-data-from-cloud-asset-throws-error/m-p/11522046?page=1
-
Anonymous commented
To sum it all up, my requests are:
-maybe you could provide me with a better solution to read the desired XMP-field from cloud-stored files?!
-If not, please implement a method to Extendscript to read the XMP-field "Creditline"
-Please implement a function to bulk download Assets from the Creative Cloud (As users have been complaining since YEARS now)Also: InDesign Version 15.1.2