Skip to main content
Known Participant
February 12, 2026
Question

InDesign UXP workflow for making a plugin to run scripts from buttons in a panel

  • February 12, 2026
  • 3 replies
  • 38 views

Hello, 

 

Looking to run scripts from a UXP plugin - the scripts would do well to be packed in a neat panel of icons rather than out of the way in the scripts panel. All my attempts of making such have been fruitless, as I have zero idea of workflow. Do I have to rewrite scripts or can I just wire up buttons to scripts in part of the UXP package, etc 

 

Any help/examples on this would be great 

 

thank you 

 

Smyth

    3 replies

    Peter Kahrel
    Community Expert
    Community Expert
    February 13, 2026

    Here’s a script that does what you want, presenting all scripts in the Scripts folder as a list of buttons, though it’s an ExtendScript script, not a (UXP) plug-in:

    https://payhip.com/b/JPDGk

    And here’s a script that shows the scripts in a list, which I think is more useful (it shows the ten last-used scripts first, you can use type-ahead to filter the list dynamically, etc):

    https://creativepro.com/files/kahrel/indesign/runscript.html

    Ask yourself whether your tool must be a plug-in, and whether a script wouldn’t do the job. If you want to avoid the Scripts panel you can create a shortcut key for the script, or create a menu item for it.

    Fred.L
    Inspiring
    February 12, 2026

    Hey,

    I’m thinking/working on the same thing so I’d give my input if I may. Feel free guys to correct me if I’m wrong. 

     

     

    What you ask should be possible (I haven’t done it yet myself and didn’t find anyone  having done it yet either), but it can’t be as straightforward as you speak of it.

     

    We need to remind ourself that Uxp is sandboxed, and this is really something we have to understand before doing anything else. One of the things this means is that when the plugin begins, everything that the plugin is able to do is declared/ packed/ ready to be run. It cannot do anything else. It’s a protection thing.

    That means, in uxp, you cannot attach a script to a button on the fly, add a fancy button icon and else. Because it goes out of the sandboxing. You cannot import a function into the sand box, if I may say. Sandboxing means bullet proof boundaries. Sounds a buzzkill, I know. But there may be a workaround. Leaving a door open.

    You cannot run an uxp script via Extendscript. But you can do the other way around. UXP can run .jsx scripts, and .jsx  scripts are able to … well do much more since they are not sandboxed.

    So the idea is to create an uxp plugin that can run a JSX, let’s say a toolbar manager, that will do what you want with the scripts/ buttons and else. That should work (on the paper at least). The uxp is doing what you asked it to do: run the JSX script. It’s all right then.

    How relevant that is is not the question here. It may or may not be, depending of the needs. Not my place to judge.

    In theory you could have a hybrid kind of toolbar, part Uxp, part ExtendScript i guess (or 2 toolbars), where the jsx part would be customizable, the uxp one being fixed. Uxp is providing access to things ExtendScript don’t (management to CC library stuff for instance, afaik) so it may be of some interest for some people.

    Note that uxp plugin are loaded at the start of ID but nothing is run/ opened. As uxp plugin are dockable (are panels, like any other panel in ID), you can put the bar somewhere and it should still be there when you restart ID.

     

     

     

    Legend
    February 13, 2026

    Here some ideas:

     

    For your fancy icon there are likely more ways but you could either start with data URLs

    https://developer.mozilla.org/en-US/docs/Web/URI/Reference/Schemes/data

    or you use UXP plugin dedicated schemes.

    https://developer.adobe.com/indesign/uxp/resources/recipes/file-operation/

    > For sandbox, you can use plugin:/plugin-data:/and plugin-temp:/.

    Store your icon within plugin-data, until the next version update purges that, or maybe even keeps it alive. UXP infancy troubles.

    Or modify an inlined style element embedded into your plugin html, with any valid css including the data URL.

     

    For invokation of the script, you would use app.doScript . It is pretty flexible about its first argument, e.g. it could be an UXP file object that has gone thru all sandboxing hassles, or it could be a source code string that you loaded yourself from any file or from your website, or something hard wired it into your code.

    One other argument includes the script language, and that includes IDJS so you can run an UXP script – even coming from ExtendScript

    ScriptLanguage UXP_SCRIPT is the script language though, not the UXP plugin language. It does not inherit sandbox settings from the UXP plugin manifest. Tthere was a a dedicated page in UXP InDesign docs which lists concrete manifest settings, search it yourself. You don’t have access to internals of your fine UXP plugin from there, or net access, but otherwise …

    The opposite is also true, call JSX from IDJS, and you can do double indirection.

    E.g. app.doScript(“app.doScript(File(arguments[0]),ScriptLanguage.other)”,ScriptLanguage.JAVASCRIPT,[“/path/to/file.vbs”]);

    This is the principle. Fill in the appropriate enums yourself, balance brackets, I did not syntax check.

    leo.r
    Community Expert
    Community Expert
    February 12, 2026

    you may also want to post UXP-related questions here:

    https://forums.creativeclouddeveloper.com/c/indesign/72