Activate custom column only in a folder with a small # of items

Since JS is too slow (has unavoidable per-file-item overhead), evaluator is too simplistic/buggy and there are no simple column examples of native dll column plugins you can't have a universal custom column plugin without suffering some visible slowdowns of regular folder opening.

But now we have a native integration with Everything, which gives the count of folder/file items in a folder "for free" to DOpus

So is there a way to write a custom JS column, but only make it work inside a folder that has below 1000 items, and otherwise do nothing and not incur any performance penalty?

Start the script with

if (tab.all.count > 1000) return;

and you should be ok.

Which information do you want to display?

What makes you say the Evaluator is too simple/buggy?

Have you tried a script column? They work fine for most things.

Which information do you want to display?

Size (with/without various links), count (regular file/folder count, then e.g., hardlink count if >1)

What makes you say the Evaluator is too simple/buggy?

The bugs I've encountered Evaluator column data disappears on refresh
Or the various limitations that make converting a script of a few hundred lines too painful and without a certainty that it's even possible Evaluator columns issues/questions

Have you tried a script column? They work fine for most things.

Yes, I mention its poor performance in the post?

Now the script takes several times longer before the spinner disappears (although the columns are empty) :slight_smile:
I guess that count property is expensive

(also, conceptually, this doesn't avoid invoking a script on every item?)

No.

I guess in that case your only option is to turn off the script before entering a folder with many items.


Maybe columns could get a switch that prevents them from being automatically calculated if certain conditions are met (too many items, types of files, location, etc.).