I’m writing InDesign plugin using UXP. I need to get the GUID of plugin user.
The code:
As stated in docs, added to manifest.json
"requiredPermissions": {
"enableUserInfo": true
}
and getting userId in main.js
const { entrypoints, userInfo } = require("uxp");
const { app } = require("indesign");
entrypoints.setup({
commands: {
showAlert: () => showAlert()
},
panels: {
showPanel: {
show({node} = {}) {}
}
}
});
showAlert = () => {
const dialog = app.dialogs.add();
const col = dialog.dialogColumns.add();
const colText = col.staticTexts.add();
let userId = userInfo.userId(); // Get the GUID of plugin user
colText.staticLabel = "Congratulations! You just executed your first command. "+ userId;
dialog.canCancel = false;
dialog.show();
dialog.destroy();
return;
}
The problem is that userId returns empty. I’m successfully logged in with Creative cloud account. InDesign and UXP versions are appropriate.
Could you please help to find the problem?