Apparently, according to a boot, there were options in the renamer for custom scripts. I just wast to add the folder size to the folder name a such:
Original:
FOLDER
Change to:
FOLDER 1 [Folder size]
Example: Movies [4], where 4 is 4 gigabytes
Is this possible?
Append folder size to Folder name using the Special Renaming function
Re: Append folder size to Folder name using the Special Renaming function
Code: Select all
end (exists(<curitem>) != 2), "No folder selected, aborted!";
$size = foldersize(<curitem>, "<r>");
$size = replace(formatbytes($size, "GB", "0"), " GB");
$name = <curname> . " [$size]";
renameitem($name, <curitem>);
One of my scripts helped you out? Please donate via Paypal or paypal_donate (at) stdmail (dot) de
Re: Append folder size to Folder name using the Special Renaming function
Thank you for this! Can this be edited to show up to 2 decimal spots: [18.87] and also to work on more than one file at a time?
Re: Append folder size to Folder name using the Special Renaming function
I tried to research this and then just started guessing and to get the 2 decimal points I changed the "0" to "2"
end (exists(<curitem>) != 2), "No folder selected, aborted!";
$size = foldersize(<curitem>, "<r>");
$size = replace(formatbytes($size, "GB", "2"), " GB");
$name = <curname> . " [$size]";
renameitem($name, <curitem>);
Now if I can only figure out how to run it on more than one folder at a time. If I select 2 or more folders it only appends the last folder.
end (exists(<curitem>) != 2), "No folder selected, aborted!";
$size = foldersize(<curitem>, "<r>");
$size = replace(formatbytes($size, "GB", "2"), " GB");
$name = <curname> . " [$size]";
renameitem($name, <curitem>);
Now if I can only figure out how to run it on more than one folder at a time. If I select 2 or more folders it only appends the last folder.
Re: Append folder size to Folder name using the Special Renaming function
Code: Select all
setting "BackgroundFileOps", 0;
foreach($item, <get SelectedItemsPathNames>, <crlf>, "e") {
if (exists($item) != 2) { continue; }
$size = foldersize($item, "<r>");
$size = replace(formatbytes($size, "GB", "2"), " GB");
$name = gpc($item, "file") . " [$size]";
renameitem($name, $item);
}
One of my scripts helped you out? Please donate via Paypal or paypal_donate (at) stdmail (dot) de
Re: Append folder size to Folder name using the Special Renaming function
Thank you so much!