Newest File column

I've added the script and created a new button with above lines:

@ifset:COLUMNSTOGGLE="scp:Newest File Column/NewestFileDate"
Set COLUMNSREMOVE="scp:Newest File Column/NewestFileDate"
Set COLUMNSREMOVE="scp:Newest File Column/NewestFileName"
@ifset:else
Set COLUMNSADD="scp:Newest File Column/NewestFileDate"
Set COLUMNSADD="scp:Newest File Column/NewestFileName"

When clicking this button I get those errors in script log:

image

The path was a network share, FWIW.

When using this button on a local drive C, for example, the columns are enabled (or disabled) but their content is empty.
Maybe I did not fully understand the intention behind those new columns?

Not sure what's going on there in both cases. I can't reproduce either of them, even with the ".." item turned on (which might have explained the null modified time, but doesn't seem to be a factor when I try it here).

The script will throw an error if it gets run on an empty folder with IncludeFolders checked.

Replacing line 164

if (IncludeFolders && NewestItem.modify.Compare(scriptColData.item.modify) < 0)

with

if (!NewestItem || IncludeFolders && NewestItem.modify.Compare(scriptColData.item.modify) < 0)

should help.

That is, however, not a solution for the other errors, I am afraid.

Thanks, good catch! I've fixed the scripts in the root post.

I love you guys, @Leo and @lxp :heart_eyes: