Skip to main content
Known Participant
March 28, 2019
Question

ExtendScript XMP getLocalizedText not working

  • March 28, 2019
  • 1 reply
  • 506 views

Using the example here: http://estk.aenhancers.com/10%20-%20Scripting%20Access%20to%20XMP%20Metadata/accessing-the-xmp-scripting-api.html#integr…

The script fails on the call to

xmp.getLocalizedText( XMPConst.NS_DC, "title", null, "en" )

The reason given is:

TypeError: Bad argument list, usage: 'getLocalizedText(schemaNS: String, altTextName: String, genericLang: String, specificLang: String): XMPProperty'

I have tried passing in "en-US" as the generic and specificLang, but it makes no difference. I also checked the typeof XMPConst.NS_DC, and it is a string. So I don't get what is causing the issue?

This topic has been closed for replies.

1 reply

Known Participant
March 28, 2019

OK, found the answer, you just need to check

xmp.doesPropertyExist(XMPConst.NS_DC, "title")

before trying to access the property. If the property doesn't exist, then you get the error I was getting previously. The resource I was using says for getLocalizedText:

Returns a String, or undefined if no matching value is not found.

Which doesn't tally with the return type of XMPProperty given by the error message. I don't know if there is any up to date documentation for the ExtendScript XMP classes?