Open JScript dialog from context menu

Hello all! This is my first post to the forum.

I have created a toolbar command script with a custom dialog to create a JSON file and populate a jsonObject.
Now, I would like to use the JSON file type, "open action" script to load the JSON file into the dialog for editing.
However, I've found that the scripts attached to the context menu do not support Dialogs and their resource files. Is there another way to invoke a dialog script when opening a file?
Thanks, -Stan

The best way is to turn the script into a script add-in (probably one which adds a script-command), then just run that from the context menu.

You can create script add-ins via Settings > Scripts.

Thank you. An add-in script does the job.

A couple of follow-up questions ...

  • Is it possible to share a dialog resource between an Add-in script and a Button script or does it need to be replicated?
  • Is there a way to position the dialog when showing it in response to a context menu click?
    Thanks!

Easiest way is to make the button call a command the add-in provides, so everything is in the add-in.

The dialog object has x, y, and position properties for that. You can get the mouse pointer position via the SysInfo object.

Great! Thank you.