Always show folders sizes as a script
Always show folders sizes as a script
Is there a way to script "Always show folders sizes" so it can be toggled on and off without having to go to config to do it?
Windows 10 Pro 22H2
-
klownboy
- Posts: 4397
- Joined: 28 Feb 2012 19:27
- Location: Windows 11, 25H2 Build 26200.7171 at 100% 2560x1440
Re: Always show folders sizes as a script
This script will do that, but unless you've had "Always show folder sizes " checked AND have cached the results by having Cache folder sizes" checked and even "Show cached folder sizes only", this will take some time. Not to accomplish the Configuration change (you won't see that) but for obtaining the folder sizes.
For a script or UDC:
For a script or UDC:
sendkeys '{PGUP}%l{ENTER}';#600;-
admin
- Site Admin
- Posts: 64915
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Always show folders sizes as a script
Possible:
Code: Select all
settingp "showfoldersizeinlist", 1; //Always show folder sizes -> ON
settingp "showfoldersizeinlist", 0; //Always show folder sizes -> OFF
FAQ | XY News RSS | XY X
-
klownboy
- Posts: 4397
- Joined: 28 Feb 2012 19:27
- Location: Windows 11, 25H2 Build 26200.7171 at 100% 2560x1440
Re: Always show folders sizes as a script
Hey that works too and better. I don't use Show folder sizes myself. It appears using SC setting, show folder sizes pinpoints to the current drive or folder which is good, whereas changing the setting in Configuration seems to be global (i.e., it appeared to be collecting folder sizes in C: drive when I was currently in E: drive).
-
admin
- Site Admin
- Posts: 64915
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Always show folders sizes as a script
Hmm, probably a bug in settingp "showfoldersizeinlist". It should update both panes, not only the active one.
FAQ | XY News RSS | XY X
-
klownboy
- Posts: 4397
- Joined: 28 Feb 2012 19:27
- Location: Windows 11, 25H2 Build 26200.7171 at 100% 2560x1440
Re: Always show folders sizes as a script
I'm not so sure that's a bad thing especially if the user is only using a single pane...and it was a pretty quick as reflected in the status bar whereas the change via Config went on and on and on...
By the way, did you ever see this wish back in July, viewtopic.php?t=27723. Obviously, it wasn't urgent. I figured it might be nice for the user to be able specifically set the Info Tips On/OFF and Hover box ON/OFF for a specific folder(s) if desired as opposed to a more global settings in Configuration.
By the way, did you ever see this wish back in July, viewtopic.php?t=27723. Obviously, it wasn't urgent. I figured it might be nice for the user to be able specifically set the Info Tips On/OFF and Hover box ON/OFF for a specific folder(s) if desired as opposed to a more global settings in Configuration.
-
admin
- Site Admin
- Posts: 64915
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Always show folders sizes as a script
It may not always be a bad thing, but it's a bug that needs to be fixed.
FAQ | XY News RSS | XY X
Re: Always show folders sizes as a script
Perfect. Thanks, Don.admin wrote: ↑06 Dec 2024 14:57 Possible:
Code: Select all
settingp "showfoldersizeinlist", 1; //Always show folder sizes -> ON settingp "showfoldersizeinlist", 0; //Always show folder sizes -> OFF
Windows 10 Pro 22H2
Re: Always show folders sizes as a script
So this is the code I came up with for my custom button:admin wrote: ↑06 Dec 2024 14:57Code: Select all
settingp "showfoldersizeinlist", 1; //Always show folder sizes -> ON settingp "showfoldersizeinlist", 0; //Always show folder sizes -> OFF
Code: Select all
$a = getkey("ShowFolderSizeInList", "Settings");
if ($a == 0) {
setkey "1", "ShowFolderSizeInList", "Settings";
settingp "showfoldersizeinlist", 1;
}
else {
setkey "0", "ShowFolderSizeInList", "Settings";
settingp "showfoldersizeinlist", 0;
}
If I add a 'title', it works and also if I comment out the title:
Code: Select all
// "Toggle Always Show Folder Sizes"
$a = getkey("ShowFolderSizeInList", "Settings");
if ($a == 0) {
setkey "1", "ShowFolderSizeInList", "Settings";
settingp "showfoldersizeinlist", 1;
ctbstate(1);
}
else {
setkey "0", "ShowFolderSizeInList", "Settings";
settingp "showfoldersizeinlist", 0;
ctbstate(0);
}Windows 10 Pro 22H2
Re: Always show folders sizes as a script
Missing indentation
One of my scripts helped you out? Please donate via Paypal
-
admin
- Site Admin
- Posts: 64915
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Always show folders sizes as a script
I still wonder why you want to toggle "Always show folder sizes" as a script. You know there is a built-in toolbar button to toggle it for the current list?
FAQ | XY News RSS | XY X
Re: Always show folders sizes as a script
Because, as you said, the toolbar button is only for the current list. So if I then want to view sizes in subfolders, or another folder, or return to the original folder, I have to keep pressing that button. So I temporarily turn always show on for as long as I need it and then turn it off again.
Windows 10 Pro 22H2
Re: Always show folders sizes as a script
Your issue is likely a trailing space on the first line, CTBs support many different things, so to match it as being a script automatically, it needs to follow certain criteria.
Re: Always show folders sizes as a script
Yes!!!! That's what it was. Thank you so much
Windows 10 Pro 22H2
XYplorer Beta Club