You are not logged in.
Pages: 1
couldn't find anything on this. is there a function that counts the number of folder contents (maybe even filtered by file type) and adds that number to the folder name?
Offline
This can be done with the Pascal Script rule.
The script below will insert into the folder name the number of files contained within the folder. You can adjust the FileMask and Recursive constants to suit your needs. The number is currently appended to the end of the folder name, but this can also be customized in code.
const
FileMask = '*';
Recursive = False;
var
ContainedFiles: TWideStringArray;
begin
if WideDirectoryExists(FilePath) then
begin
SetLength(ContainedFiles, 0);
WideScanDirForFiles(FilePath, ContainedFiles, Recursive, False, False, FileMask);
FileName := FileName + ' ' + IntToStr(Length(ContainedFiles));
end;
end.
Offline
thanks mate! that works fabbo. and I'm kinda proud I even got to modify it so it now prints "_[XXFILES]"
and that's really good for someone so logic challenged lol
if I also wanted to contents of folders to be matched to a database (like TVDB) and verified I probably should go another route/tool, should I? or is this something I could figure out using pascal script as well?
Offline
if I also wanted to contents of folders to be matched to a database (like TVDB) and verified I probably should go another route/tool, should I? or is this something I could figure out using pascal script as well?
We could probably hack something together in Pascal Script, but it does sound like a task for a more specialized tool, i.e. developed specifically for that purpose.
Offline
Pages: 1