Column that "OR"s two columns?

I'd like to create a column that merges two other columns, like an OR function, or "if-then-else". Specifically, for a folder with photos I'm using the exiftool script from the dopus site, which has a column for "Model (exif)" that shows the camera model for still photos, and a column "Model (qt)" that picks up the camera model for videos. It appears no photo's exif data has both. So I'd like a single column that shows Model, which includes both the still and video results. In my mind this would be like an OR function between the two columns; or something like If column C (the still result) is not empty, show C's result, otherwise show column D (the video result).
If not easy, maybe I could do it within the exiftool script? TY.

It would be rather tricky/impossible to do within the script, but luckily we now have eval columns :slight_smile:

XML
<?xml version="1.0"?>
<evalcolumn align="0" attrrefresh="no" autorefresh="no" foldertype="all" keyword="t48001" maxstars="5" namerefresh="no" reversesort="no" title="t48001" type="0">exifmodel = Val(&quot;scp:ExifTool/EXIF-Model&quot;);
qtmodel = Val(&quot;scp:ExifTool/QuickTime-Model&quot;);

return exifmodel == &quot;&quot; ? qtmodel : exifmodel;</evalcolumn>

Is there any description, what those eval columns exactly do, or any collection of useful stuff, like in the buttons/scripts subforum?

Release Notes Columns

Not in any organized form, but there are some here...

https://resource.dopus.com/c/opus-13-beta/opus-13-beta-examples/45

... and you can search for them quite well.

https://resource.dopus.com/search?q=evalcolumn

Would it be faster to avoid calculating the 2nd column if the 1st one is non-empty?

Maybe it doesn't matter with both columns coming from the same script (if it calculates both values at once anyway) but it might speed things up if the two columns come from different places.

Thanks. It sure looks useful, even though in most cases they look to specific. At the moment, only one idea comes too my mind, which would be a column, that shows if a folder or subfolder contains a GPX file. This is not a code support request.

Yes, but not a lot. The slowest part is building the cache. Once that's done retrieving the data will be very fast.

But if it were one internal (e.g. "Camera Model") and one script column I'd avoid unnecessary calls.

1 Like

This evaluator script works sometimes and unpredictably?? I selected a folder in the tree, and added this evaluator column in the lister, and it shows the expected result. I then select a different folder in the tree, in this case an exact copy of the first folder, and the evaluator column in the lister is blank. Removing the column and re-adding it doesn't fill it in, nor does F5. I also tried creating an identical evaluator column with a different name, and sometimes that works. It seems to me that it needs to be told to refresh evaluation when changing folders?

Yes, I've noted this as well. My findings are put together here:

https://resource.dopus.com/t/eval-columns-that-access-script-columns-dont-refresh-properly/48010

I guess these types of issues are currently on the back burner, so we'll need a bit of patience.

That’s it. TY.