Copy link to clipboard
Copied
Hi,
I'm having a specific issue with a caption generation script in InDesign 2025 v20.4. The script can read image descriptions but not credit lines.
My situation: Claude wrote me a "Better Captions" script that automatically generates captions from image metadata (credit lines and descriptions) — then styles and sizes them properly, saving lots of extra steps. It's suddenly not reading the credit tag. The images definitely contain the metadata - I can verify this by going to Object > Captions > Generate Static Caption which works perfectly and creates the caption I expect. I can also see using the Links panel > XMP File Info... > Raw Data that the <photoshop:Credit> tag. All my metadata is created in Bridge, which I also just updated today
What's working:
What's broken:
My XMP contains:
<photoshop:Credit>First Last / Organization</photoshop:Credit> <dc:description> <rdf:Alt> <rdf:li xml:lang="x-default">Long description text here...</rdf:li> </rdf:Alt> </dc:description>
What I've tried for credit extraction:
The weird thing is that the UI can see both fields perfectly, and my script can extract the description just fine - it's specifically the photoshop:Credit field that's not accessible via scripting anymore.
Has anyone else noticed this? Is there a new way to access the photoshop:Credit field in 2025 v20.4, or is this a regression? This worked fine in previous versions and is breaking my automated caption workflow.
Thanks for any help!
This works for me in InDesign 20.3.1 on Mac
var myDoc = app.activeDocument;
var myLink = myDoc.allGraphics[0].itemLink;
var myLinkXmp = myLink.linkXmp;
var myResult = myLinkXmp.getProperty("http://ns.adobe.com/photoshop/1.0/", "photoshop:Credit");
alert("Credit line: " + myResult);
BINGO, you got it. I am very much not a programmer/scripter and appreciate the help! Claude was trying to use linkXmpPacket, attempting to call .toString().trim() and was using XMPConst instead of full namespace URLs.
For credits, what worked was linkXmp.getProperty("http://ns.adobe.com/photoshop/1.0/", "photoshop:Credit")
For descriptions, it's using direct access with linkXmp.description
Thanks again!
Copy link to clipboard
Copied
What happens in the steps you've taken, ie parsing the xmp. Is the field visible in that read approach or not.
Copy link to clipboard
Copied
The XMP parsing can successfully read the dc:description field, but the photoshop:Credit field returns null/undefined despite being present in the raw XMP and accessible through the UI.
If I run the script as posted, the credit area is just left blank. When I add diagnostics to show me what's happening, it says the data doesn't even exist. I can then immediatley use the built in UI to generate a caption, and the credit line will flow right in.
Copy link to clipboard
Copied
Try to roll back to InDesign 20.3.x (Creative Cloud app > InDesign > Other Versions menu). Will it make a difference?
InDesign 20.4 introduced some scripting and plug-in bugs which may or may not be related to the problem you describe.
Copy link to clipboard
Copied
This works for me in InDesign 20.3.1 on Mac
var myDoc = app.activeDocument;
var myLink = myDoc.allGraphics[0].itemLink;
var myLinkXmp = myLink.linkXmp;
var myResult = myLinkXmp.getProperty("http://ns.adobe.com/photoshop/1.0/", "photoshop:Credit");
alert("Credit line: " + myResult);
Copy link to clipboard
Copied
Hi @Kasyan Servetsky ,
tested your script with InDesign 2025 v20.3.0 and also with v20.4.0.52 on macOS.
In both versions it will work and alert the contents of the credit line.
Regards,
Uwe Laubender
( Adobe Community Expert )
Copy link to clipboard
Copied
BINGO, you got it. I am very much not a programmer/scripter and appreciate the help! Claude was trying to use linkXmpPacket, attempting to call .toString().trim() and was using XMPConst instead of full namespace URLs.
For credits, what worked was linkXmp.getProperty("http://ns.adobe.com/photoshop/1.0/", "photoshop:Credit")
For descriptions, it's using direct access with linkXmp.description
Thanks again!
Find more inspiration, events, and resources on the new Adobe Community
Explore Now