Format in which sense? I'm not sure I understand the questiom, sorry. Can you give more details, and maybe some examples of what happens vs what you want to happen?
Leo,
The configuration for each column do not work as expected or intended when the config is different for each column. If both are set to "auto," the columns appear as expected:
If both are set to "Units," the columns appear as expected:
However, when both are set differently, they default to the Age (C) config:
I'm guessing it's because the "Created" config comes first in the script. I would like for the columns to be independently configured, if possible.
So what am I missing?
Thanks for taking a look!
Is the last full snippet still the one you are using?
I spotted a weird thing in OnAddColumns():
..
var method = ["Auto","Units"];
cmd.method = method[Script.config["Modified"]];
..
I get the idea behind, but if this is still the way you do it, it's actually surprising this works at all.
You should remove the dquotes around "Auto" and "Units", since you want the functions to be passed and not strings containing their names.
After changing the script config it might also be necessary to use the OnAfterScriptConfigChange() event or what it's exact name is.
In that call Script.InitColumns() to rebuild them with the updated function reference in cmd.method = .. I might be wrong and if that does not cure your issues, consider uploading a current version to play with. Thx! o)
Taking out the dquotes totally kills the script. I have included it for your consideration.
Column.Generic_Age_Working.js.txt (7.83 KB)
Yes, sorry, forget what I said about the dquotes. I mixed things up with the j(ava)script I do elsewhere currently. The column.method property expects a string with a function name of course, not a reference to a function (which would be just the name of the function without the dquotes).
There error is somehwere else and it is not in the way you assign functions for the columns. It's in the column functions, as they always set both columns. That's why you cannot have one column showing units, while the other is set to auto.
I removed some of the duplicate code which served both columns at the same time.
The column function now only act on one column at a time, so using different methods for each makes sense eventually.
Column.Generic_Age_Working.js.txt (11.8 KB)
While I tinkered with that script I was also able to reproduce a script column bug I saw with another script. So if the uploaded fix works for you, I guess we have a win win situation here. o)
Thanks for the help tbone.
Unfortunately, your adjustment didn't solve the issue, although it changed it a bit. Regardless of config (same or different), only the first column opened will display info based on its specific setting. The other column, when opened, will appear blank. With both columns displayed, Refresh All will display Age (C) in its specific config and Age (M) blank.
It just doesn't seem to want to work through the functions independently. Not sure what's missing...
Watch this, it seems you're also affected by the bug I was talking about: resource.dopus.com/viewtopic.ph ... 96#p154696
tracking!
@tbone
This script no longer works - Failed (init) for Win 11, Opus 13.18.2. It is way over my head. I would be appreciative, if you could repair it or even if not!
I didn’t inspect the script itself, but following the request of this thread, the evaluator column listed here might do what you want: Column: Modified and Created age - #7 by dpuser441 .
Just add a new column at Preferences / File Display Columns / Evaluator Columns
.
Mhh, these two Columns from the "Generic-Age" script still seem to work for me (first Age column in screenshot).
My own columns though, in that "ModifiedWithin" script, seem to show some weird numbers now, which I cannot make any sense from. Not sure which set of columns you are referring to, I guess the first one, but in that case I can't help. I don't run Win11 yet.. and probably won't for quite some time.
I tend to switch operating systems if they reach end of life. o) I switched to Win10 only 2-3 years ago, when my machine (SSD) corrupted and I had to reinstall anyway. I generally don't feel switching away from a working Windows installation prematurely, because it took an immense amount of time to fine tune and setup over the years.
Maybe a Win11 user can step in?!..
Thanks for the quick response. I did go with an evaluator but only after responded to this forum thread.
I did just last week get a new SFF computer since Win 10 is out of support in early October. Note that if you opt for buying a year of security patches for Win 10, you MUST login with a MS account.
As to tuning Win 11, you'll be 90 % there if you get StartAllBack for $5 and True Launch Bar for free, a menu program using existing .lnk files.
Honestly I don't feel like hacking the Taskbar and Menu, it should "just" work, but I use a floating toolbar of DO as a Start-Menu replacement already, because Start-Menus of Windows degrade more and more.
That Win11 task bar does not support additional toolbars and widgets anymore but I need to see network IO when I work on the computer for a lot of things, "did copy complete?" or "is still downloading and not responding because of that?" etc..
So, that "NetSpeedMonitor" I use currently does not work anymore with Win11 and every replacement solution is a hack, which positions separate windows above the taskbar to mimic the old appearance and behaviour of NetSpeedMonitor, but it's quite obvious that this is not a proper solution and falls apart quickly (when resizing the task bar or items get added / removed e.g.).
I need to find a solution before I even consider to reinstall from scratch with Win11 for serious usage. Not sure what Microsoft is doing. I am not an anti-Windows person in general, but specific aspects of the desktop and the settings application(s) got really horrible over the years.. o( In that regard, a simple Linux desktop like "XFCE" is a much nicer experience, but Linux has other problems of course, sigh! o)
If anybody has an Evaluator for "Age Column" which handles "less than one day" by using "hours" as a unit and BOTH variants (since creation and mofication).. please post, I think I keep that script version otherwise.
Can hack this one.
<?xml version="1.0"?>
if (operation == "sort")
return Age(createddate);
date_now = Now();
when_created = createddate;
mins = Age(when_created, "n");
hours = Age(when_created, "h"); // buggy
hours = Abs(mins / 60);
days = Age(when_created, "d");
weeks = Age(when_created, "w");
months = Age(when_created, "m");
years = Age(when_created, "yyyy");
return_value = "---";
if (mins < 0) // for dates set in the future
{
return_value = "Future";
return return_value;
}
elseif (days > 365)
{
return_value = years > 1 ? years + " years" : years + " year";
}
elseif (days > 0)
{
return_value = days > 1 ? days + " days" : days + " day";
}
elseif (hours > 0)
{
return_value = hours > 1 ? hours + " hours " : hours + " hour ";
mins_left_over = mins - (hours \* 60);
return_value += mins_left_over > 1 ? mins_left_over + " minutes" : mins_left_over + " minute";
}
elseif (mins > 0)
{
return_value = mins > 1 ? mins + " minutes" : mins + " minute";
}
else
{
return_value = "0 minutes";
}
return return_value;
Thanks! o) Such an evaluator column seems to be much faster than a script and it also does not lazy load values, am I right? Very interesting, this was the first evaluator column I tried, the performance difference is really remarkable, but you can't do all columns as evaluator and I guess you also should not.
Will keep learning about the Evaluators.. o)
Here is another one using evaluator.
The script does not work in Win 10 either. Broke with 13.18.1.
Not sure how to resolve it, but happy others have provided viable options.
Here's an updated version. It required a ConfigHelper update per @eugenesv's update to @tbone's ConfigHelper:
Helper: ConfigHelper (easier config item handling) - #14 by eugenesv
Column.Generic_Age.js.txt (12.6 KB)