InDesign UXP自定义XMP命名空间UI不可见:是否为预期行为及解决方法?
InDesign UXP自定义XMP命名空间不显示问题
我在InDesign UXP环境中运行以下JS代码,注册自定义XMP命名空间并设置相关属性:
const { app } = require("indesign"); const { XMPMeta } = require("uxp").xmp; const doc = app.activeDocument; const xmp = new XMPMeta(doc.metadataPreferences.rawXMP); console.log("xmp"); console.log(xmp); var namespaceURI = "https://test.com/"; var prefix = "test"; // define new namespace XMPMeta.registerNamespace(namespaceURI, prefix); xmp.setProperty(namespaceURI, "creator", "test"); xmp.setProperty(namespaceURI, "website", "https://test.com/"); xmp.setProperty(namespaceURI, "email", "test@gmail.com"); doc.metadataPreferences.rawXMP = xmp.serialize(); console.log("Updated rawXMP:", xmp.serialize()); console.log("creator:", xmp.getProperty(namespaceURI, "creator")); console.log("website:", xmp.getProperty(namespaceURI, "website")); console.log("email:", xmp.getProperty(namespaceURI, "email"));
代码执行后,自定义命名空间及字段已成功序列化并在日志中输出,但在InDesign的「文件信息→原始数据」中无法看到这些内容。我有以下疑问:
- 这是否是UXP中自定义XMP命名空间的预期行为?
- 如何在InDesign UI中验证或显示自定义XMP元数据(是否仅支持标准命名空间)?
补充说明:InDesign UXP并非运行在浏览器环境,使用window、XML等浏览器特性会触发错误。
内容的提问来源于stack exchange,提问作者ashwin lohiya
相关产品推荐
相关产品推荐

