Filters (12): folders enhancement

Would you like Bulk Rename Utility to offer new functionality? Post your comments here!

Filters (12): folders enhancement

Postby TheGhost78 » Sat Jan 10, 2026 12:02 pm

If you add, for example, *.mp3 or *.jpg to the Mask, and tick Folders, no folders will be returned because folders are not mp3 or jpg files. This configuration of options is currently useless - so give it a use! If you select folders while filtering for a particular file type, return folders that contain mp3 or jpg files. Or, perhaps add another tickbox for Folders Containing...
TheGhost78
 
Posts: 254
Joined: Fri Jul 19, 2024 11:25 am

Re: Filters (12): folders enhancement

Postby Admin » Sun Jan 11, 2026 9:01 am

Hi, since the mask can now be used to filter folder inclusion based on the folder name, yes I think a new option Folders Containing could be needed, or maybe even better a new syntax for the mask, with containing: at the start, e.g. containing:.mp3 *.jpg means folder containing and then the mask applied to the files within the folder. You should be able to use the Condition in Filters (12) to achieve the same:

object('isdir') && (countFilesInFolder('*.mp3') > 0 || countFilesInFolder('*.jpg') > 0)

Notes:
- countFilesInFolder, when applied to a folder, counts files inside that folder (use patterns like "*.mp3", "*.jpg").
- If you want to include subfolders in the count, call countFilesInFolder("*.mp3", true) (second parameter = includeHidden; includeSystem is third). There is no built-in recursive flag for countFilesInFolder, so to inspect nested folders you would need a different approach (e.g., listFilesInFolder and custom checking in JS).
- Ensure Filters (12) has "Folders" checked; otherwise folders won’t be shown/selected.
Admin
Site Admin
 
Posts: 3136
Joined: Tue Mar 08, 2005 8:39 pm


Return to Suggestions