Workflow iterating on scripts in command editor

When working on a script for a custom button it's quite a few clicks to get the editor open to the command (right click toolbar, customize mode, commands, scroll to user commands, double click my command in the list). If I want to test my changes, I have to close the editor + customize mode, click the button, and see what happened.

I see there's a run button but I don't think I can use that with a JScript function since the button can't be clicked when customize mode is open. I also see the Opus CLI but again I think I need the clickData from the callback to be able to do anything useful in JScript.

Any workflow tips?
It would be great if I could have the command editor open without being in customize mode, and the command editor had a "Save" or "Apply" button in addition to the OK and cancel ones.

I found two tips that really help!

  • You can shift click the button while in customize mode to trigger it.
  • JScript Run button does appear to be triggering the event. DOpus.Output(string) works and is quite helpful in debugging.

Biggest tip is: Don't use user commands. There's almost no reason to use them, especially if you're using scripting.

If you only need the command in one button, you can put it in the button directly, and you can run it from the editor (Run button at the bottom of the window, or F5.)

If you need the command in multiple buttons, turn it into a script add-in instead of a user command. You can then edit the script in a text editor without Opus even being in customize mode.

(The only time I use user commands these days is when I want to add a command to the taskbar jump list. But even then, I test it in a normal button first.)

2 Likes