Scriptaddins.oxc corruption?

When I tried to add a command called "qnd" by saving qnd.js to /scripts it showed up in my list of script addins in Preferences as qnd.js instead of qnd and its status was disabled despite being set to enabled in the script itself.

I created a copy of qnd.js called qne.js with the only difference in the body of the script being the command name - qne vs qnd. The qne command showed up correctly in Preferences.

After a bit of poking around to see what might be going on, scriptaddins.oxc became the prime suspect so I saved the "bad" config, shut Opus down, renamed scriptaddins.oxc to scriptaddins.cxo, and restarted Opus. As expected, Opus rebuilt scriptaddins.oxc and now both qnd and qne showed up correctly.

I will attach a zip with scriptaddins.oxc (working, post rebuild) and scriptaddins.cxo (broken, pre rebuild).

One thing that struck me about the post rebuild scriptaddins.oxc is that is contains entries for several scripts that no longer exist anywhere in my config. Presumably these obsolete entries are pulled from the registry. Is there a way of getting Opus to clean the registry up to remove them? Does it matter?

This issue may be related to this thread from 2016.

scriptaddins.zip (7.6 KB)

My guess is that the first time the script was saved it could not be read (maybe the editor held an exclusive lock on it or similar?), or had an error in the code, which meant it ended up being disabled (which is the default state if OnInit isn't found or cannot be run to make it otherwise).

Same for the script name; the filename is used if OnInit doesn't provide a name.

There's no corruption in that file; it looks completely fine.

Nothing related to this is stored in the registry.

That file keeps information about old scripts in case you reinstall them. That way settings and other details saved for old scripts will carry over if you sometimes add or remove the scripts, instead of it all being lost.

Also note that a lot of the information shown in the Preferences / Scripts page is cached in /dopuslocaldata/State Data/scriptprefs.osd.


If you run into a similar problem in future, just edit the file and it should cause Opus to re-load it and re-run the OnInit function. (And if it's disabled, enable it.)

If it keeps happening, it might indicate the text editor you're using is doing something weird, or maybe antivirus is locking the file just after it is created (which wouldn't be too weird, given it's a script, although good antivirus should be more transparent than to make operations fail instead of make them wait for the scan to complete).

Thanks for taking a look. I am 100% certain that it is not editor related. I use Notepad++ all day and every day and both qnd and qne were saved from the same editor session. qnd is my "Quick 'n Dirty" template for working on scripts that will eventually get a real name, so it gets reused a lot.

I have a saved copy of the config with the problem so when time permits I'll do a bit more digging to see if I can narrow it right down. It's a nit, not an issue.