Folder sizes calculated on demand with a single click
Folder sizes calculated on demand with a single click
What about this:
In the size column, filesizes are calculated automatically as usual but the size of a particular folder would be calculated on demand when the size column for that particular folder is clicked.
It can be done currently with a keyboard shortcut but that requires AFAIK two clicks and two hands (one for the keyboard, one for the mouse). If this was implemented it would be much more comfortable and faster IMO. For example in Custom Event Actions, there could be a "Size column left/right click" for this. I would'n want to use whole row item middle clicks just for this.
I am was trying to script this with Extra columns and Custom columns but I have not found a way. Do you think it could be scripted somehow? Remember, it all needs to be shown within a single column. Or is there actually something like this?
In the size column, filesizes are calculated automatically as usual but the size of a particular folder would be calculated on demand when the size column for that particular folder is clicked.
It can be done currently with a keyboard shortcut but that requires AFAIK two clicks and two hands (one for the keyboard, one for the mouse). If this was implemented it would be much more comfortable and faster IMO. For example in Custom Event Actions, there could be a "Size column left/right click" for this. I would'n want to use whole row item middle clicks just for this.
I am was trying to script this with Extra columns and Custom columns but I have not found a way. Do you think it could be scripted somehow? Remember, it all needs to be shown within a single column. Or is there actually something like this?
Re: Folder sizes calculated on demand with a single click
If you don't want it as a keyboard shortcut put the script on a button / in the catalog? Requires only one click.
Apart from that a scripted custom column that would execute the recalculation but this can't be combined with the displayment of the size in the same column...
Apart from that a scripted custom column that would execute the recalculation but this can't be combined with the displayment of the size in the same column...
One of my scripts helped you out? Please donate via Paypal
Re: Folder sizes calculated on demand with a single click
Thanks.
Actually still two clicks: one click to select a folder, the second click to calculate. But it is just one hand so better.
Actually still two clicks: one click to select a folder, the second click to calculate. But it is just one hand so better.
Re: Folder sizes calculated on demand with a single click
Not with a cc column, it's only a single click necessary...
One of my scripts helped you out? Please donate via Paypal
Re: Folder sizes calculated on demand with a single click
Probably hardcoded, it doesn't exist in the resource graphic file...
One of my scripts helped you out? Please donate via Paypal
-
admin
- Site Admin
- Posts: 64916
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Folder sizes calculated on demand with a single click
It's a live drawing, a circle and a triangle.
FAQ | XY News RSS | XY X
-
GreetingsFromPoland
- Posts: 283
- Joined: 29 Sep 2022 14:20
- Location: Win10 @125%
Re: Folder sizes calculated on demand with a single click
update i was able to get what i wanted using this
would you mind sharing/posting the script commands you used for the sizes ? i can't seem to get the formatting correct using
thanks!
return formatbytes(foldersize(,"<b>"), "FLEX"); in the column script.hi! this is very cool. currently i have "Folder Sizes" (#487;) in my Hamburger menu but i may try this approach.
would you mind sharing/posting the script commands you used for the sizes ? i can't seem to get the formatting correct using
foldersize(), maybe there is another way.thanks!
Last edited by GreetingsFromPoland on 13 Jul 2024 15:44, edited 1 time in total.
Re: Folder sizes calculated on demand with a single click
Here is the code. It is super simple. The if is there for multiple item selection.GreetingsFromPoland wrote: ↑13 Jul 2024 15:35would you mind sharing/posting the script commands you used for the sizes ? i can't seem to get the formatting correct usingfoldersize(), maybe there is another way.
thanks!
Code: Select all
if !<cc_isselected> {
selectitems <cc_item>;
}
load "#487",,s;
return "";
Last edited by Brano on 13 Jul 2024 15:46, edited 1 time in total.
Re: Folder sizes calculated on demand with a single click
Re: Folder sizes calculated on demand with a single click
I've put some effort to this:

It needs two columns.
One extra column:
and one custom column
There is a bit of a problem with a flick each time the list is refreshed and a change is made.

It needs two columns.
One extra column:
Code: Select all
//a string for a button in the extra column
$buttonEmpty = "◁";
$buttonFull = "◀";
//limit to folders
if property("#2", <extra_item>)=="File folder" {
selectitems <extra_item>;
load "#487",,s;
//set extra column label
extratag(1,"$buttonFull Folder size (right-click to calculate)" );
return $buttonFull;
}
Code: Select all
//a string for a button in the extra column
$buttonEmpty = "◁";
$buttonFull = "◀";
$anyChange = FALSE;
//run only onece per whole folder
if <cc_index>==1 {
//reset Ex1---------------------------------------
//get all subfolders
$content = folderreport("dirs", "r",,,,"|",);
//set extra columns
foreach ($i, $content) {
if tagitems("ex1",, $i)!=$buttonEmpty {
tagitems("ex1", $buttonEmpty, $i);
$anyChange = TRUE;
}
}
//set extra column label; no use, causes a flick
extratag(1,"$buttonEmpty Folder size (right-click to calculate)" );
if $anyChange {
//refreshlist;
}
}
XYplorer Beta Club

