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

XMPMeta does not have a constructor

Explorer ,
Mar 07, 2018 Mar 07, 2018

Hi,

I've encountered the above error when doing

var xmp = new XMPMeta(xmpBlob);

The strange thing is, after I call other function with the exact code (which somehow works), calling the same code in the original function works.

I don't where to begin debug... it's not consistent.

Thanks!

TOPICS
SDK
1.4K
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 1 Correct answer

Explorer , Mar 07, 2018 Mar 07, 2018

I think I found it!

I guess every time that some "services" or "dependencies" are going to be used (which one, I don't know ...) - you have to initialize it or declare it.

The code I used is:

if (ExternalObject.AdobeXMPScript === undefined) {

     ExternalObject.AdobeXMPScript = new ExternalObject('lib:AdobeXMPScript');

}

If only there was documentation... It'd be some much easier.

Translate
Explorer ,
Mar 07, 2018 Mar 07, 2018

I think I found it!

I guess every time that some "services" or "dependencies" are going to be used (which one, I don't know ...) - you have to initialize it or declare it.

The code I used is:

if (ExternalObject.AdobeXMPScript === undefined) {

     ExternalObject.AdobeXMPScript = new ExternalObject('lib:AdobeXMPScript');

}

If only there was documentation... It'd be some much easier.

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
Explorer ,
Aug 23, 2018 Aug 23, 2018

Thank you for sharing this information. Now it does not throw error about constructor but it does not read or set the value either.

here is what I am doing

if (ExternalObject.AdobeXMPScript === undefined) { 

     ExternalObject.AdobeXMPScript = new ExternalObject('lib:AdobeXMPScript'); 

var docXmp = new XMPMeta(app.activeDocument.XMPString);

var nodeValue = docXmp.getProperty(XMPConst.NS_XMP, nodeName);

Do you see any obvious mistake?

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
Explorer ,
Aug 24, 2018 Aug 24, 2018
LATEST

found the gap : need to add .toString()

var nodeValue = xmp.getProperty(XMPConst.NS_XMP, nodeName).toString();

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