Alert Hello World in UXP

At the risk of repeating myself on another Indesign forum…

Not so much jumping into the deep end but going swimming with cement flippers with UXP, I try to create an alert in InDesign .injs:

But not quite as friendly as I’d hoped.

I can get around it by writing a bespoke alert function as mentioned in this recipe here.

However… it says here that Since UXP v7.4, alert() can only be invoked in plugin via the featureFlags enableAlerts. Update your Manifest v5 with the following:

so I’ve updated the manifest:

{
  "id": "myUniqueId",
  "name": "Hello Worldplugin",
  "version": "0.0.1",
  "description": "Description goes here",
  "summary": "Summary goes here",
  "host": {
    "app": "XD",
    "minVersion": "13.0"
  },
  "uiEntryPoints": [
    {
      "type": "menu",
      "label": "Create Rectangle",
      "commandId": "createRectangle"
    }
  ],
  "featureFlags": {
     "enableAlerts": true
 }
}

with just one line script:

alert("hello!");

based on the Developer Starter project - so ignore references to rectangles. But get the same error as above.

So what’s going on?

The docs page you linked to, clearly says:

  1. Since UXP v7.4, alert() is disabled for scripts

And in your post you wrote:

an alert in InDesign .injs

.injs is a script, not a plugin

But since the terms script and plugin are so frequently used as synonyms it really doesn’t help.

Not sure what you mean by this, but scripts aren’t plugins, no matter how you use the terms :thinking::man_shrugging:

Different ecosystems and/or platforms call same things differently and different things the same. In every case you’d need to address the docs and Adobes docs clearly distinguish scripts from plugins. I believe you’ve got your answer and it’s not going to change no matter how you prefer things to be called :man_shrugging:

@adobe Please update the docs. There are several missing pages: Platform Concepts, Debugging a Script, Migrating, Object Model, Right to Left Scripting, IDJS File Association…