A files highlight by default? Add folder name to file name?

Bulk Rename Utility How-To's

A files highlight by default? Add folder name to file name?

Postby MilesOldfield » Mon Feb 08, 2021 4:15 pm

I'm renaming a few thousand folders and I was wondering:
Is it possible to have all files highlighted by default when opening a folder?
Is there a way to have the folder name appended to the names of the files inside the folder?

What I have is a bunch of subfolders with the year, and within each year are twelve subfolders for the months. I'd like to change the files from:

filename.ext ==> year-mo - filename.ext

Thanks!
MilesOldfield
 
Posts: 11
Joined: Sat Nov 14, 2020 9:26 pm

Re: A files highlight by default? Add folder name to file name?

Postby Luuk » Mon Feb 08, 2021 10:38 pm

With menu, there is "Actions", "List", "Auto-Select All Items" to highlight all by default. To prefix the two closest folders, the AppendFolderName(9) settings...
Name.. "Prefix"
Sep..... "-"
Levels.. "2"
But first removing checkmark from "Folders" inside Filters(12), so only renaming the files to... "year-mo-filename.ext".

After the rename, to correct the second "-" into " - ", first clicking "Reset" then the Replace(3) settings...
Replace... "\second\-"
With...... " - "

==================================================================

This another way, but only conducts properly with the latest version 3.4.2.0...
First rename using AppendFolderName(9) to get "mo - filename.txt"...
Name.. "Prefix"
Sep.... " - "
Levels. "1"

Second rename using AppendFolderName(9) to get "year-mo - filename.txt"...
Name.... "Prefix"
Sep.... "-"
Levels. "-2"

This one gives me idea for puttings things like "-2--1 - " inside the "Levels" so needing only one rename, but the separators do not conduct like "Custom" inside the AutoDate(8), so still needing two renames anyway.
Luuk
 
Posts: 700
Joined: Fri Feb 21, 2020 10:58 pm

Re: A files highlight by default? Add folder name to file name?

Postby Admin » Tue Feb 09, 2021 12:17 am

Because in Javascript renaming one has access to the object full path with :

object("folder")

then one could extract easily the folders needed from the full path and append them to the name with different separators with a script.
However, as Luuk has shown in his post, it can also be done without Javascript.

Luuk is one of the masters of BRU!!! 8)
Admin
Site Admin
 
Posts: 2351
Joined: Tue Mar 08, 2005 8:39 pm

Re: A files highlight by default? Add folder name to file name?

Postby MilesOldfield » Wed Feb 10, 2021 10:50 am

Yes! This is exactly what I was looking for. Thank you very much! :D
MilesOldfield
 
Posts: 11
Joined: Sat Nov 14, 2020 9:26 pm


Return to How-To