Sorting files by filename part?

Hi,

I wanted to ask does current scripting power allows to do such thing?

For example here is my files:
text_123_456_789.txt
text_456_789_123.txt
text_789_123_456.txt

I need to be able to sort this files by 1st, 2nd or 3rd value independently (values are delimited by underscore here). So if I sort by 2nd value it must look like:
text_789_123_456.txt
text_123_456_789.txt
text_456_789_123.txt

Any help will be appreciated.

I don't think it is possible to affect DOpus sort through scripting atm.
It is quite possible to sort filenames and whatnot according to whatever you want using
scripting, but you can't affect DOpus sorting in any way, so it is kind of useless to do so.

It would require either a custom sort callback (which would slow down DO significantly as it'll be called very very often), or
that DO let the script handle the sorting on its own on a per-folder basis.

There's no way to do that directly.

However, you could have a button or similar which copies part of the filename into another field, like the User Command field, and then sort by that.

I was only 90% sure It isn't possible as is. So it was worth asking)
I think I'll use renaming scripts then, putting the part required for sorting to the beginning of the filename.

@myarmor, @leo
Thanks for reply guys =)

I posted an answer here.
You must have 11.5.1 beta or higher installed to use the script.
Save the code as a .js file into the script addin folder.

Enable the script, then rightclick on the column headers, then select Columns->Script->Col1, Col2, and Col3.
Now you can sort based on the part you want the usual method clicking the respective column.