Can one add a sortkey to an existing column?

Can one add a sortkey to an existing column? I only know how to specify scriptColData.sort for a new column.

Reason: I want to be able to sort by any chosen substring of the filestem, possibly reversed. This substring could be the 8-digit datestring at the end of many items, or the text following some initial 3-digit index.

Workaround: I can easily reduce the Name column to 1 pixel, then add a new column after it that specifies scriptColData.value to be the filestem and scriptColData.sort to be the required sortkey. It would be more straightforward, however, to add the sortkey to the existing Name column if such a thing is possible.

Scripts can only specify the way their own columns work. There's no way for them to change the way a built-in column sorts, or a column from another script.

Adding to the reply above:

An alternative to making the Name column 1 pixel wide might be to have the script column not display anything, but set its sort values so you can sort by it when clicking on it (or via a command that sorts by it explicitly).

Then you retail the ability to sort normally by clicking the Name column.

Thanks, leo. That confirms what I had expected.

Your suggestion is better than my workaround. I will leave the Name column alone, and because I use keystrokes to sort, the new column can be 1 pixel wide. Then the sort string can go into the displayscriptColData.value in case one ever needs to widen the column and see what is going on, and correspondingly scriptColData.sort can be omitted. I'll post the script eventually.

Now posted at A script to sort on substrings of the filestem . Thank again for the advice.

Thanks for sharing the result!