Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Help: Script can't read photoshop:Credit metadata in InDesign 2025 v20.4

Community Beginner ,
Jun 17, 2025 Jun 17, 2025

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:

  • Description extraction via ExtendScript (dc:description) - works fine
  • UI caption generation (Object > Captions > Generate Static Caption) - sees both credit and description perfectly

 

What's broken:

  • Credit extraction via ExtendScript (photoshop:Credit) - returns empty/null
  • Various XMP access methods for credit field specifically

 

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:

  • xmp.getProperty(XMPConst.NS_PHOTOSHOP, "Credit")
  • Regex parsing of linkXmpPacket looking for <photoshop:Credit>
  • generateStaticCaption() method (fails entirely)
  • Various other XMP access approaches

 

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!

TOPICS
Bug , Scripting
524
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 2 Correct answers

Valorous Hero , Jun 18, 2025 Jun 18, 2025

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);

 

Translate
Community Beginner , Jun 18, 2025 Jun 18, 2025

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!

Translate
Community Expert ,
Jun 17, 2025 Jun 17, 2025

What happens in the steps you've taken, ie parsing the xmp. Is the field visible in that read approach or not.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 17, 2025 Jun 17, 2025

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 17, 2025 Jun 17, 2025

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Jun 18, 2025 Jun 18, 2025

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);

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 18, 2025 Jun 18, 2025

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 )

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 18, 2025 Jun 18, 2025
LATEST

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!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines