Unable to load the AdobeXMPScript library in Indesign CC 2021

Adobe Community Professional ,
May 06, 2021 May 06, 2021

Copy link to clipboard

Copied

Hi everyone,

I am trying to execute the following method to load AdobeXMPScript library. This perfectly works in Indeisgn CC 2020 and console 'success' which is expected behaviour but unfortunately in Indesign CC 2021, it gives an alert 'Unable to load the AdobeXMPScript library'

 

function loadXMPLibrary() {
    if (!ExternalObject.AdobeXMPScript) {
        try { ExternalObject.AdobeXMPScript = new ExternalObject('lib:AdobeXMPScript'); }
        catch (e) { alert('Unable to load the AdobeXMPScript library!'); return false; }
    }
    return true;
}

var myFile = app.activeDocument.fullName;

// check library and file
if (loadXMPLibrary() && myFile !== null) {
    xmpFile = new XMPFile(myFile.fsName, XMPConst.FILE_INDESIGN, XMPConst.OPEN_FOR_UPDATE);
    var myXmp = xmpFile.getXMP();
}

if (myXmp) {
    $.writeln('success')
}

 

What are the reasons behind it?

Is there any change to load these libray in latest version?

OS Version : MacOS BigSur

 

 

 

Best regards
TOPICS
Bug, Scripting

Views

866

Likes

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

Adobe Community Professional , May 07, 2021 May 07, 2021
Ok. Now I had the chance to run Hans-Gerd's code on InDesign 16.1.0.20. This is working as expected. It's not working with 16.2.1.100 installed from the Prerelease tab. Hm. Don't know if the up-coming version of 16.2 that is currently rolled out in phases will react the same way. Best I'll do a bug report at InDesign Prerelease.* All done on Windows 10 Pro version 2004. Regards, Uwe Laubender ( ACP ) EDITED * Now I know, that the rolled out version 16.2.1.102 has the same problem. But ...

Likes

Translate

Translate
Adobe Community Professional ,
May 06, 2021 May 06, 2021

Copy link to clipboard

Copied

Hi Charu,

I see the same with Hans-Gerd Claßen's restored code from 2014 here:

https://community.adobe.com/t5/indesign/adding-name-of-indesign-document-to-metadata-of-all-images-u...

 

With InDesign 2020 there is no issue. All is working very well.

However it fails with the current InDesign version 16.2.1.100 on my Windows 10 machine.

 

Thanks for reporting this serious issue!

 

Regards,
Uwe Laubender

( ACP )

Likes

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
Guru ,
May 06, 2021 May 06, 2021

Copy link to clipboard

Copied

Hi Uwe,

I just tested the script you mentioned in your post and it does work for me without any problems in InDesigm 16.1 x64 (Windows 10).

Unlike the active doc, links can be 'opened for update'.

2021-05-07_00-35-21.png

Likes

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
Adobe Community Professional ,
May 06, 2021 May 06, 2021

Copy link to clipboard

Copied

Thank you @Laubender  for confirming it is a bug.

I think, it started happening with 16.2 as @Kasyan Servetsky  says it works fine with 16.1

Can we forward this bug to the relevant team so that it will be fixed as soon as possible?

 

Best regards

Likes

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
Adobe Community Professional ,
May 07, 2021 May 07, 2021

Copy link to clipboard

Copied

Hi Charu,

is your 16.2. version 16.2.1.100 ?

And if so, was it installed from the Prerelease tab in your Creative Cloud Desktop App?

 

FWIW: If I run your code from the ESTK I can see the error message Kasyan also had.

I'm on Windows 10 Pro version 2004.

 

Regards,
Uwe Laubender

( ACP )

Likes

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
Adobe Community Professional ,
May 07, 2021 May 07, 2021

Copy link to clipboard

Copied

Hello Uwe,

My version is 16.2.1.102 and it is not downloaded from prerelease tab. I have updated normally yesterday from the app section of the Creative Cloud

 

FWIW: If I run your code from the ESTK I can see the error message Kasyan also had.

I'm on Windows 10 Pro version 2004.

Yes, I also tested and got the same error message as Kasyan mentioned on Windows for Indesign 2020 but it works fine on mac for Indesign 2020.

 

Best regards

Likes

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
Guru ,
May 06, 2021 May 06, 2021

Copy link to clipboard

Copied

Your code ain't working for me both in 2020 and 2021 (on Windows 10).

The library is loaded, but the file fails to open for update throwing an error: "XMP Exception: Open, other failure".

If I change UPDATE to READ, it works.

function loadXMPLibrary() {
    if (!ExternalObject.AdobeXMPScript) {
        try { ExternalObject.AdobeXMPScript = new ExternalObject('lib:AdobeXMPScript'); }
        catch (e) { alert('Unable to load the AdobeXMPScript library!'); return false; }
    }
    return true;
}

var myFile = app.activeDocument.fullName;

// check library and file
if (loadXMPLibrary() && myFile !== null) {
    var xmpFile = new XMPFile(myFile.fsName, XMPConst.FILE_INDESIGN, XMPConst.OPEN_FOR_READ);
    var myXmp = xmpFile.getXMP();
	var xmpStr = myXmp.serialize();
	$.writeln(xmpStr);
}

if (myXmp) {
    $.writeln('success');
}

 

Likes

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
Adobe Community Professional ,
May 06, 2021 May 06, 2021

Copy link to clipboard

Copied

@Kasyan Servetsky 

I just cross checked and it's true when UPDATE is used it gives an error on Windows but on Mac for 2020.

Thank you for this information.

 

Best regards

Likes

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
Adobe Community Professional ,
May 07, 2021 May 07, 2021

Copy link to clipboard

Copied

Ok. Now I had the chance to run Hans-Gerd's code on InDesign 16.1.0.20.

This is working as expected.

 

It's not working with 16.2.1.100 installed from the Prerelease tab.

Hm. Don't know if the up-coming version of 16.2 that is currently rolled out in phases will react the same way.

Best I'll do a bug report at InDesign Prerelease.*

 

All done on Windows 10 Pro version 2004.

 

Regards,
Uwe Laubender

( ACP )

 

EDITED

 

* Now I know, that the rolled out version 16.2.1.102 has the same problem.

But there is hope at the horizon. A bug fix is under way.

Likes

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
Adobe Community Professional ,
May 07, 2021 May 07, 2021

Copy link to clipboard

Copied

Thank you. 🙂

 

Best regards

Likes

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
Adobe Employee ,
May 28, 2021 May 28, 2021

Copy link to clipboard

Copied

Hi there!


The fix is expected in 16.3.

Likes

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
New Here ,
May 30, 2021 May 30, 2021

Copy link to clipboard

Copied

LATEST

Any ETA on 16.3? Not sure whether I can track upcoming releases somewhere.

Likes

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
Adobe Community Professional ,
May 28, 2021 May 28, 2021

Copy link to clipboard

Copied

Erin said: "The fix is expected in 16.3."

Yep. Already tested successfully the fix with that version at Prerelease.

 

Regards,
Uwe Laubender

( ACP )

Likes

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