Copy link to clipboard
Copied
Hi Adobe Community,
I'm trying to custom XMP metadata into an InDesign file using uxp scripting
Here is the code I'm using
This sets the property xmp:Name vkumarg /xmp:Name under the standard XMP namespace (http://ns.adobe.com/xap/1.0/).
However, after saving and reopening the file in Adobe InDesign, and going to:
File → File Info → Advanced → Raw Data
"The xmp:Name tag and value are not shown."
Is this the correct way to write custom XMP metadata using UXP in InDesign?
Why is the value not being shown in the rawInput section?
Yep, your script is working on a blank XMP packet.
Better use InDesign's own API.
Just came across the ExtendScript example translated to UXP, in the Photoshop docs.
Rewritten to use UXP file system calls.
https://developer.adobe.com/photoshop/uxp/2022/uxp-api/reference-js/Modules/uxp/XMP/getting-started/
Better don't attempt that on your open InDesign document.
Copy link to clipboard
Copied
Might be a bug, considering that uxp xmp should also work from other programs.
Is that an official tag, though? Maybe some validation taking place.
Retry with "CreatorTool" (mentioned in ExtendScript XMP docs)
If you're in InDesign anyway, also have a look at doc.metadataPreferences.
https://developer.adobe.com/indesign/dom/api/m/MetadataPreference/
Copy link to clipboard
Copied
I'm also missing file operations along these (taken from ExtendScript), your script sounds like you're working on a detached XMP object. The XMP library does not know that you have an active document. The same script could be running in Photoshop, and still deal with an InDesign document.
Copy link to clipboard
Copied
Yep, your script is working on a blank XMP packet.
Better use InDesign's own API.
Copy link to clipboard
Copied
How to register this two namespace
xmlns:stMfs="http://ns.adobe.com/xap/1.0/sType/ManifestItem#"
xmlns:stRef="http://ns.adobe.com/xap/1.0/sType/ResourceRef#"
I have use xmpMetaObject
XMPMeta.registerNamespace(namespaceURI, suggestedPrefix)
XMPMeta.registerNamespace(
"http://ns.adobe.com/xap/1.0/sType/ManifestItem#",
"stMfs"
);
XMPMeta.registerNamespace(
"http://ns.adobe.com/xap/1.0/sType/ResourceRef#",
"stRef"
);
My reference is from the official Adobe documentation:
https://extendscript.docsforadobe.dev/scripting-xmp/xmpscript-object-reference/#xmpmeta-object
File → File Info → Advanced → Raw Data not show why ?
Copy link to clipboard
Copied
Just came across the ExtendScript example translated to UXP, in the Photoshop docs.
Rewritten to use UXP file system calls.
https://developer.adobe.com/photoshop/uxp/2022/uxp-api/reference-js/Modules/uxp/XMP/getting-started/
Better don't attempt that on your open InDesign document.
Copy link to clipboard
Copied
Thank you, sir I appreciate your help!
But when I try using
XMPMeta.registerNamespace()
it doesn’t show
Copy link to clipboard
Copied
Again, you are NOT working on the active InDesign document.
You are working on a separate XMP object.
The other examples are how Bridge or any other program would work on external files with XMP - images, PDFs, anything you would place in InDesign. In principle you can also modify a closed InDesign document that way, but as you have it open in InDesign better change it through the metadataPreferences.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now