Skip to main content
Charu Rajput
Community Expert
Community Expert
May 6, 2021
Answered

Unable to load the AdobeXMPScript library in Indesign CC 2021

  • May 6, 2021
  • 9 replies
  • 4617 views

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

 

 

 

Correct answer Laubender

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.

9 replies

bagonterman
Inspiring
June 18, 2025

Running test :

#target indesign

try {
    if (ExternalObject.AdobeXMPScript === undefined) {
        ExternalObject.AdobeXMPScript = new ExternalObject("lib:AdobeXMPScript");
        alert("AdobeXMPScript loaded successfully.");
    } else {
        alert("AdobeXMPScript was already loaded.");
    }
} catch (e) {
    alert("Failed to load AdobeXMPScript:\n" + e.toString() + "\n\nStack:\n" + e.stack);
}

And for versions 20.3.1 it works and loads on both mac and PC. However it does not load on version 20.4 mac. Has anyone seen this reported?

Community Expert
June 18, 2025

Hi @bagonterman ,

there are several new bugs with scripting in InDesign 20.4.0.52.  ExternalObject is broken.

Also File.execute() and Folder.execute(). There may be more things broken…

 

InDesign 2025 20.4 breaks a whole host of CEP extensions.
RorohikoKris, Jun 16, 2025
https://community.adobe.com/t5/indesign-discussions/indesign-2025-20-4-breaks-a-whole-host-of-cep-extensions/td-p/15373071


v20.4.0.52 ExtendScript Folder.execute() does not work anymore
Laubender, Jun 17, 2025
https://community.adobe.com/t5/indesign-discussions/v20-4-0-52-extendscript-folder-execute-does-not-work-anymore/m-p/15373812#M628420

 

Regards,
Uwe Laubender
( Adobe Community Professional )

abdulazizj97689116
Participant
June 1, 2022

The bug exists now on my laptop:

 

Device name LAPTOP-GO2JNFJQ
Processor AMD Ryzen 7 4800H with Radeon Graphics 2.90 GHz
Installed RAM 16.0 GB (15.4 GB usable)
Device ID 84411421-6190-4CE9-8511-6A6EC115A6F4
Product ID 00325-96700-16024-AAOEM
System type 64-bit operating system, x64-based processor
Pen and touch Touch support with 10 touch points

 

Edition Windows 11 Home
Version 21H2
Installed on ‎11/‎3/‎2021
OS build 22000.675
Experience Windows Feature Experience Pack 1000.22000.675.0

 

Adobe InDesign Version: 17.2.1.105
Defaults File Version: 1
SavedData File Version: 19
Installed Plug-ins: 244

Community Expert
June 1, 2022

Hi,

let's hope that the fix for this bug is available in all regions of the world with InDesign 17.3.0 at the end of this or early next week. Currently version 17.3.0 is available for Australia, Belgium, Canada, France, Hong Kong, India, Italy, the Netherlands, Switzerland and the United Kingdom based on Adobe IDs.

https://helpx.adobe.com/indesign/kb/fixed-issues.html

 

Regards,
Uwe Laubender
( Adobe Community Professional )

Community Expert
April 28, 2022

Now I had a chance to test the code on Windows 10 with InDesign 17.2.0 and 17.2.1.105.

Both fail.

 

ERROR: 52, I/O error
Unable to load the AdobeXMPScript library!

 

Regards,
Uwe Laubender

( ACP )

Community Expert
April 26, 2022

Seems that this issue is back with InDesign 2022 version 17.2.0.

 

At least on Windows machines!

It still works with 17.1.0.50, but there is evidence that it fails on version 17.2.0. on Windows 10.

 

Could someone test with 17.2.1 on Windows and MacOS as well?

I still waiting for 17.2.1 here in Germany…

 

See bug report at InDesign UserVoice:

 

AdobeXMPScript v 17.2.0.20
Windows 10
Jim McKee, April 26, 2022
https://indesign.uservoice.com/forums/601180-adobe-indesign-bugs/suggestions/45080362-adobexmpscript-v-17-2-0-20

 

Also this new discussion:

 

IO error creating ExternalObject('lib:AdobeXMPScript')
jimm22973083, April 25, 2022
https://community.adobe.com/t5/indesign-discussions/io-error-creating-externalobject-lib-adobexmpscript/td-p/12903790

 

 

Regards,
Uwe Laubender

( ACP )

Charu Rajput
Community Expert
Community Expert
April 26, 2022

Hi @Laubender 

AdobeXMPScript is working on mac for Indeisgn version 17.2.1
Best regards
Community Expert
July 5, 2021

Well, I expect 16.3 every day.

And that for some weeks now…

 

Regards,
Uwe Laubender

( ACP )

Charu Rajput
Community Expert
Community Expert
July 5, 2021

I think it has been rolled out in some of the regions of the world. I have 16.3.2 version, may be it will be released soon for all.

 

 

Best regards
Community Expert
May 28, 2021

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

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

 

Regards,
Uwe Laubender

( ACP )

dulajun
Inspiring
July 3, 2021

I have an extension for InDesign and solving this bug is crucial to run the software. And until now I didn't get the 16.3 update! Could you please tell me when the update will come?

abdulazizj97689116
Participant
May 31, 2022

This bug returned on Windows. So please fix it as quickly as possible.

LaubenderCommunity ExpertCorrect answer
Community Expert
May 7, 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 there is hope at the horizon. A bug fix is under way.

Charu Rajput
Community Expert
Community Expert
May 7, 2021

Thank you. 🙂

 

Best regards
Kasyan Servetsky
Legend
May 6, 2021

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');
}

 

Charu Rajput
Community Expert
Community Expert
May 7, 2021

@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
Community Expert
May 6, 2021

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-used-in-document/m-p/12020029#M425207

 

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 )

Kasyan Servetsky
Legend
May 6, 2021

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'.