You are not logged in.
Pages: 1
Example File: "C:\Program Files\Microsoft Office\Office10\1033\webcomp\expedia\DIRECTS.ICO"
:File_Drive: > C
:File_Folder1: > Program Files
:File_Folder2: > Microsoft Office
:File_Folder3: > Office10
...
:File_Folder9:
:File_FolderRev9:
...
:File_FolderRev3: > 1033
:File_FolderRev2: > webcomp
:File_FolderRev1: > expedia
.
Read the *WIKI* for HELP + MANUAL + Tips&Tricks.
If ReNamer had helped you, please *DONATE* to Denis or buy a PRO license. (Read *Lite vs Pro*)
Offline
Considering that the path could be up to 260 chars (Unicode paths up to 32,767 chars), we could theoretically have paths like "C:\a\b\c\d\e\..."). In this case, how many ::File_Folder: variables do you expect? Too little and the feature makes no sense since it doesn't cover all cases, so ideally Denis would need to ensure that the maximum possible parts are covered.
With PascalScript of course it's easy to simply split the string using \ or / as the delimiter.
Offline
how many ::File_Folder: variables do you expect?
Exactly 9 +9, as shown above.
Considering that the path could be up to 260 chars [...]
we could theoretically have paths like "C:\a\b\c\d\e\...").
I think more then nine (or even eighteen) parent folders no one would seriously need to use in the file name.
That may cover 99% of the average user case, for the rest there is still PascalScript.
But for the majority of users the renaming with strings from parent folders
would be much more easier with this variables, without asking for an PascalScript (*).
Not all of them are as experienced as you.
I think: commonly needed features should just be there, without the need to search much for them.
(*) BTW, such an PascalScript could be for example:
(NOTE: use this example with one or two files only.
For real use remove the "output" lines and un-comment the "// FileName := " line)
var
Folders: TStringsArray;
Parent, GrandParent, GrandGrandParent, TopMost, SecondTopMost, output: WideString;
begin
Folders := WideSplitString(WideExtractFileDir(FilePath), '\');
TopMost := Folders[1];
SecondTopMost := Folders[2];
GrandGrandParent := Folders[Length(Folders)-3];
GrandParent := Folders[Length(Folders)-2];
Parent := Folders[Length(Folders)-1];
//Test output:
output := output + 'FilePath ' + FilePath + #13#10;
output := output + 'FileName >> ' + FileName + #13#10;
output := output + 'TopMost Folder >> ' + TopMost + #13#10;
output := output + 'SecondTopMost >> ' + SecondTopMost + #13#10;
output := output + 'GrandGrandParent >> ' + GrandGrandParent + #13#10;
output := output + 'GrandParent >> ' + GrandParent + #13#10;
output := output + 'Parent >> ' + Parent + #13#10;
output := output + 'Drive >> ' + WideReplaceText(Folders[0],':','') + #13#10;
ShowMessage ( output );
// Build the New Name:
// FileName := SecondTopMost + '_' + FileName;
end.
(Note: "FilePath" and "FileName" are build-in variables and always present without declaring first)
And yes, you could also use "Folders := WideSplitString(FilePath, '\');", but then the index from the right
would not anymore be such logical then they are shown above (hint: they would start from -2 instead, then -3 and so on)
.
Read the *WIKI* for HELP + MANUAL + Tips&Tricks.
If ReNamer had helped you, please *DONATE* to Denis or buy a PRO license. (Read *Lite vs Pro*)
Offline
Interesting idea.
We'll see if more people will ask for the same feature...
Offline
Very diplomatic
Read the *WIKI* for HELP + MANUAL + Tips&Tricks.
If ReNamer had helped you, please *DONATE* to Denis or buy a PRO license. (Read *Lite vs Pro*)
Offline
Pages: 1