Skip to main content
Participant
Jun 17, 2025 8:10 PM UTC
Answered

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

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!

Kevin23266480586bCorrect answer
Participant
Jun 18, 2025 7:31 PM UTC

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!

6 replies

Kasyan Servetsky
Legend
Jun 18, 2025 8:17 AM UTC

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 Expert
Jun 18, 2025 11:38 AM UTC

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
brian_p_dts
Community Expert
Community Expert
Jun 17, 2025 9:25 PM UTC

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

Translate
Participant
Jun 17, 2025 9:41 PM UTC

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
leo.r
Community Expert
Community Expert
Jun 18, 2025 3:41 AM UTC

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