You could show us the script. Or maybe as Leo suggested, try debugging it. Put some calls to DOpus.Output in it so you can see when it's being called. If it's not being called at all for the label that might suggest some other label is matching it first, so you could look to see what your other labels are doing.
// Called by Directory Opus to initialize the script.
function OnInit(initData)
{
initData.name = "Column for Preview's Existence";
initData.version = "1.2";
initData.copyright = "AndersonNNunes.org";
initData.url = "";
initData.desc = "Column used to indicate if a video file has a matching image preview in a side-car file.";
initData.default_enable = true;
initData.min_version = "12.0";
var col = initData.AddColumn();
col.name = "HasPreview";
col.method = "OnHasPreview";
col.label = "Has Preview";
col.justify = "left";
col.autogroup = true;
}
// Implement the HasPreview column.
function OnHasPreview(scriptColData)
{
if (scriptColData.item.is_dir)
{
return;
}
var groups = scriptColData.item.groups;
if (typeof groups != "object")
{
return;
}
var movie = false;
for (var i = 0; i < groups.count; ++i)
{
if (groups(i) == "Movies")
{
movie = true;
break;
}
}
if (!movie)
{
return;
}
var resPath = String(scriptColData.item.realpath);
var extension = String(scriptColData.item.ext_m);
var formats = new Array();
var formatA = resPath + ".jpg";
formats.push(formatA);
var formatB = resPath + ".vtx";
formats.push(formatB);
var formatC = resPath.replace(extension, ".jpg");
formats.push(formatC);
var formatD = resPath.replace(extension, ".vtx");
formats.push(formatD);
for (var i = 0; i < formats.length; i++) {
if (DOpus.FSUtil.Exists(formats[i])) {
DOpus.Output("HasPreview: Yes!");
scriptColData.value = "Yes";
scriptColData.sort = 0; // To sort 'Yes' before 'No'.
return;
}
}
DOpus.Output("HasPreview: No...");
scriptColData.value = "No";
scriptColData.sort = 1; // To sort 'Yes' before 'No'.
return;
}
It is not called after a fresh start. It starts being called after toggling the Label Filter twice and confirming on the Preferences dialog.
Looking at the screenshot in your original post, it looks like the value "Yes" may have some leading spaces in it. It would normally be left-aligned, as shown here:
Anyway, when I try this filter here it works ok, even after shutting Opus down and restarting it. So I suspect it's due to an interaction with other filters or scripts you may have.
I want to disable all other scripts to test that. Is it safe to temporarily remove them from the scripts folder? As in, will they keep their current settings once they are back?
It appears that as long as the script for that column is the only one, the assignment works at every restart, but as soon as any other column script is enabled, it does not.