Script column value dissapears dependent on position

Hello! o)

Something I already saw with another script now caught my attention while fixing this one: Column listing age of file in days - need script help Scripted columns might end up empty, values calculated only show up for a fraction of a second. This seems to be dependent on the position of the column.

The script in the linked thread features two columns, "Age (M)" and "Age (C)".
Both columns provide information about the age of an item in reference to its creation/modified date.

Please have a look: "Age (C)" column before "Age (M)" being empty.


Drag "Age (C)" around to be just behind "Age (M)", refresh and now "Age (M)" is empty (because it's the first one?).


So, both columns do provide valid values for all of the items, but the first one will end up blank. The script makes use of multicol columns, in case that helps to find the reason for this. Any advice or further questions appreciated, these columns really need fixing now that v12 is getting major (speaking of the wiggly wobbly jumping as well o).

Cya and thanks! o)

If a script claims "multicol" it has to supply all values at once, but that script isn't - from what I can tell, the Auto() function will only supply the value for one of the columns (whichever one it gets called for).

Are you sure? As far as I can remember it wasn't necessary to provide values for all columns at once. I also guessed that's why columnData.col exists, to see which column is queried. What is suspicious here is that the correct values show up for a brief moment line by line (in the "blank" column) just to dissapear quickly again leaving the column blank eventually.

This was not the case in previous versions, looking at the columns I did for the script wizard e.g. These also don't work correctly anymore, but I did not touch them. First column won't always hold the values. I just looked into the source and there I can reproduce it with a single column.

I assume, one of us is wrong! o)

That's the whole point of multicol, if you only want to provide a single column at once then set it to false.

But look at this, it's the ScriptColumn.multicol description from the docs.
It shares my point of knowledge, it explicitly tells that it's not required to provide values for all the columns in the multicol set.

[quote]If your script implements multiple columns that require common calculations to perform, you may wish to set the multicol property. If this is set to True then your column handler function has the option of returning data for multiple columns simultaneously, rather than just the specific column it is being invoked for.

When your handler is called, the ScriptColumnData object won't contain the usual group, sort, type and value properties. Instead, it will have a columns property that points to a Map that lets you set the values for one or more of your columns at once.
...[/quote]
Whatever the result of this confusion will be. I just checked another column script where values are missing dependent on where the column is positioned and it seems the issue also happens for single type columns. So this multicol fact might not be relevant here.

Yes you're right, there does seem to be an issue here with multicol, if a script doesn't actually return all its columns in one hit. I'll look into this and hopefully get it fixed for the next beta.

Ok, alright! Thank you! o)

Tested 12.4.4b shortly, the announced fix in this version seems to work and resolves this issue. Thanks! o)

Related topic: