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

XMPMeta does not have a constructor

Explorer ,
Mar 07, 2018 Mar 07, 2018

Copy link to clipboard

Copied

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

Views

994

Translate

Translate

Report

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.

Votes

Translate

Translate
Explorer ,
Mar 07, 2018 Mar 07, 2018

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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?

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

LATEST

found the gap : need to add .toString()

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

Votes

Translate

Translate

Report

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