Find using an Evaluator column based off a script column

I've not been successful in making this work with a script-added column. Am I doing something wrong? Here's what I mean. I define a simple evaluator column like this

this gives me the following. All good so far.

but when click Find to look for the number '1' it finds nothing. If I use another field in my Evauator column such as 'desc' then it works and Find correctly gives me test1 in the results.

What I'm trying to do is use Evaluator functions to pull certain information out of this script column and then search within that information. Hope this makes some sort of sense. Thanks.

My guess is that it is because the way you're searching does not allow partial matches.
Try using instead:
=InStr(Val("eval:DescriptionX"),"1")!=-1
https://docs.dopus.com/doku.php?id=reference:evaluator:instr

Still doesn't find anything, but thank you.

Try *1*.

Thanks, but nothing found.

* works and it filters.

I tried my file index evaluator column.
Same result with my dir index evaluator column.
Find was unable to find specific values, but could find * .
Using my early Dopus 13 release photo Field of View Column I found that * limited the find to photos.

Edit Note: The find was limited to photos that actually have FOV ( really focal length ) metadata.

'*' on its own also works here but returns the complete list, as expected. This feels like it might be a small problem with DOpus.

I've added the bug-report tag to this. It's not a big issue at all but it does seem to me that DOpus isn't handling a user-defined column properly in this scenario. Thanks all.

Works here just fine.

The setup:

The files:

53880.zip

The filter:

eval match TheEvalColumn 1

The ScriptColumn:

function OnInit(initData) {
    initData.name = 'TheScriptColumn';
    initData.version = '2024-12-26';
    initData.url = 'https://resource.dopus.com/t/find-using-an-evaluator-column-based-off-a-script-column/53880';
    initData.desc = '';
    initData.default_enable = true;
    initData.min_version = '12.0';
}

function OnAddColumns(addColData) {
    var col = addColData.AddColumn();
    col.name = 'TheScriptColumn';
    col.method = 'OnColumn';
}

function OnColumn(scriptColData) {
    scriptColData.value = 'Hello World ' + scriptColData.item.name_stem.slice(-1);
}

ColumnTheScriptColumn.js.txt

The EvalColumn:

XML
<?xml version="1.0"?>
<evalcolumn align="0" attrrefresh="no" autorefresh="no" customgrouping="no" foldertype="all" keyword="TheEvalColumn" maxstars="5" namerefresh="no" reversesort="no" title="TheEvalColumn" type="0">&quot;Returning &quot; + Val(&quot;scp:TheScriptColumn/TheScriptColumn&quot;)</evalcolumn>

How interesting. Thank you for taking the trouble to do all of that. I'm going to dig some more.

Your script and evaluator column search works for me. So now I need to pin down why my main script isn't working. I'm still not sure it isn't a DOpus issue but more investigation is required.

Yes,
Your script and evaluator code works.

However, an evaluator column that simply returns the index doesn't work for specific values of index, but works fine with * .

The Index Column:

<?xml version="1.0"?>
<evalcolumn align="0" attrrefresh="no" autorefresh="no" customgrouping="no" foldertype="all" header="#index" keyword="#index" maxstars="5" namerefresh="no" reversesort="no" title="#Index" type="0">x = index;
return x;</evalcolumn>

The filter:

eval match index *

Works.
However,

eval match index 2

doesn't work.

I can't see what might be preventing my evaluator column search working either. I mean, it's just another column in DOpus so I'm really not sure why it's misbehaving.

Try setting your column's type to Unsigned (number) instead of Text.

That seems to work, Leo. The only problem being it's text I'm really interested in. In the below test I get the expected result of File 3, File 4 and test3.

If you want to match text, you should compare the value with a text string instead of a number.

I thought that's what I was originally doing. Please elaborate.

2 is a number.

”2” would be a string.

Right. I thought you probably meant that. Already tried. Doesn't find anything.

I did a little more digging with the aid of an Output statement in the Evaluator column code. When I enter a directory I can see that the Evaluator code is correctly getting the scp:DescriptionX/DescriptionX column and populating the Evaluator column. So far so good. When I bring up the Advanced Find dialog and search the Evaluator column that is displaying the right information at the time, then I see that the scp:DescriptionX/DescriptionX is blank and so nothing I search for is found. If I change scp:DescriptionX/DescriptionX to desc then it all behaves as I expect. Is this more likely to be a problem with my script addin, or is it that DOpus isn't handling the script column correctly when using Advanced Find? Thanks.

Edit: Script problem.