Script object+method to highlight portions of filenames/columns?

Now that we've got some amazing Find, Everything & FAYT features, some ridiculosly powerful options are open to us. Can we take it to the next level? :slight_smile:

DOpus can highlight matched portions of names with its builtin command like this:


You already have this implemented, so maybe can we have access to this function in scripts, too? Could be something like Item.highlightColumnPortions(colName: string, textOrPortions: string | Vector, [textcolor: string[, backcolor: string]])?

  • colName would be the column name obviously, name is probably the most common target, but could be any column, if a FAYT script implements a size, date, or some metadata related query.
  • string would simply highlight all matching portions of the column value, or if a Vector is given, each number pair would be a "from-length" tuple, or "from-to" if that's what you prefer. E.g. Vector(0,3,15,3) would highlight 2x 3 chars in 1st variant, or Vector(0,3,15,18) would do the same in 2nd variant, depending on your choice. Or maybe a Map with from, to or index, len keys. Whatever works for you best.
  • textcolor, backcolor would change the colors; e.g. in the screenshot above, textcolor would be rgb_code_for_white, backcolor would be rgb_code_for_lime.
  • any maybe some flags like bold, italic, too? It's all up to you.

This could be used in FAYT scripts, or in script-triggered search results, where the script would loop over all items and highlight portions accordingly. Since FAYT scripts in my understanding do not necessarily have to select a subset of current lister's contents and open some search results, they could do a null-selection but implement the highlighting instead. And if complex OR'ed criteria are given, the script could highlight each part in red, yellow, blue, etc. A simple command could highlight the unit portion in size column, or time portion of date-time, only file_namestem portions of location, etc. Or one could hide the size column but color the names accordingly, i.e. biggest files red, medium files yellow, small files green. This is kinda similar to filter-labels but would give far more fine-granular control.

One thing I can't estimate is the performance impact. Feel free to call this idea too far out, or suggest alternatives, or reject altogether.

1 Like

Itโ€™s a good idea. We have been thinking about it already but havenโ€™t had a chance yet to look in detail.


You guys are always a step ahead! :heart_eyes:

EDIT: now that I re-read my text, I already saw first bug :smiley:
If the colors would have to be additive, then the signature would have to look like this:

Item.highlightColumnPortions(colName: string, highlightVecMap: VectorOfMaps)

where highlightVecMap would be a Vector of Maps, where each Map would have following keys:

  • text: simple text, Dopus would find and highlight
  • index: self-explantory
  • length: self-explantory
  • textcolor: rgb
  • backcolor: rgb
  • bold: boolean
  • italic: boolean

This would allow multiple colors & formattings per filename/column.

I've asked before for a feature like this especially when using evaluator groups to colorize parts or the complete group name :+1: