Unable to import UXP XMP module ... uxp.xmp is undefined

, ,

Running either of these require lines from the UXP docs in UDT 2.0.1 playground results in an error indicating uxp.xmp does not exist. How can we use the XMP module via UXP in InDesign?

source: uxp/XMP/getting-started
const xmp = require("uxp").xmp;

xmp is undefined

source: uxp/XMP/XMP%20Classes/XMPMeta

let { XMPMeta, XMPConst } = require("uxp").xmp;
let meta = new XMPMeta();

VM36 main.js:4 Uncaught TypeError: Cannot destructure property ‘xmp’ of ‘require(…).xmp’ as it is undefined.

UDT 2.0.1
UXP 7.3.1
InDesign 19.0.1
macOS 13.6.3

1 Like

Indeed, the module does not exist.

  • macOS 12.6.7 (Apple Silicon)
  • InDesign 2024 (19.0.1)

XMP module is only available in Photoshop from UXP 7.2 onwards.

This feature needs each Host Application to do some work to enable the module and associate this the underlying XMP engine. Its a miss in the documentation to highlight the availability in applications. Will correct this information.

As far as Indesign goes, XMP should get enabled sometime early this year.

2 Likes

The XMP module is a vital part of a CEP extension we’re currently trying to migrate to UXP. Unless there are alternative methods for storing metadata in an InDesign document, we’ll have to wait for XMP to be included to continue. Thanks for the update!

1 Like

I had a similar problem and ended up using the setProperty method of metadataPreferences.

Ref: Storing custom data into InDesign file XMP

Hello there,

did you ever find a solution? Since I still get undefined if I use require(“uxp”).xmp in InDesign (20.5, on macOS 15.6 Silicon Mac but also on other machines).

Even the examples of the documentation https://developer.adobe.com/indesign/uxp/reference/uxp-api/reference-js/Modules/uxp/XMP/getting-started/ don’t work.

What could be the reason?

We recently had this in the U2U forums.

It turned out to be a limitation of UXPSCRIPT / .idjs, while it works in UXP plugins.

Hi Dirk,

really? Great. That documentation of Adobe is really a mess. Is there any hint what works in what technic?

Will the module be available for idjs, too?

Here’s the list of modules available for UXP scripting: https://developer.adobe.com/photoshop/uxp/2022/scripting/how-it-works/#permitted-uxp-modules
Other modules are only available within the context of a UXP plugin.

Yep, Photoshop scripters since 2022 apparently missed to raise issues when previously available features were stripped away.

They also missed on features that they never had, while InDesign scripters take them for granted. E.g. isolation in target engines, or that those target engines stay alive after the run to handle notifications, keep open a file or socket, or allow working with ScriptUI modeless dialogs known as palettes. All missing in PS.

Roughly speaking a full blown UXP plugin is pretty close to a 1:1 modernisation of Photoshop’s limited ExtendScript with CEP combo, which was the only way to get sophisticated work done. Switching over to UXP plugin is no big deal given a preselected group of “developers” coming from CEP, which already required a web background.

Note that I make a difference between scripters and developers.

For comparison InDesign plain jsx was a far better experience, far more powerful, and idjs is taking away a lot of that by only delivering the psjs experience. Rarely discussed, instead we see the long term InDesign scripters (in U2U) vote with their feet, stay with ExtendScript, while unsuspecting newcomers as of here are surprised when the all new environment misses out in such basics.

1 Like

Hi Tom,

thanks for your link. The information is from 2022 and about Photoshop UXP. Actually XMP is available for PSJS as far as I could test it (I don‘t have experience in PS scripting).

Like Dirk says, I will have to go back to ExtendScript :frowning: