I've been having some success with some very simple but amazingly useful scripts, but there's one little job I'd love to be able to do and the solution escapes me every time . . .
I'm trying to write a script to take the size of selected folders (directories) in the list view and copy the folder size to the comment field. It should be so SIMPLE but it's driving me MAAAAAADDD!!!
Anyway, heres what I've done so far:
Code: Select all
#431; // Toggle showing folder sizes
$size = (report("{Size GB}",1)); // Get the size of the folder
tag "$size", , 2; // Set the size in the comment field
#431; // Toggle off showing folder sizes
savesettings; // So I don't lose my comments when I exit XY!
Code: Select all
#431; // Toggle showing folder sizes
$Files = get("SelectedItemsPathNames", "|");
foreach($file, $Files, "|") {
$size = ""; // Reset the variable I'll use as a container for the size
$size = (report("{Size GB}",1)); // Get the size of the folder or file
tag "$size", , 2; // Set the size in the comment field
}
#431;
savesettings;
Code: Select all
6.7GB3.4GB2.9GB5.8GB etc etc
Having tried several times I know I'm on the wrong track here. Can anyone advise and adjust this code so it get's closer to the desired outcome?
Thanks for any advice
Biggy
XYplorer Beta Club