You are not logged in.
Pages: 1
How would I traverse subfolders to a current location and then use a piece of those folder names in the resulting file name?
The result would be- MyMovie_s01E01, ....,MyMovie_s01E04,MyMovie_s02E01...
I'm not familiar with looping in pascal and dont see any functions that would loop through.
My folder structure:
Movie1
folder_Season1_D1
File01
File02
File03
folder_Season1_D2
File01
File02
File03
folder_Season2_D2
File01
File02
File03
folder_Season2_D2
File01
File02
File03
Offline
You can use the ":File_FolderName:" meta tag to access the parent folder name, but there is no meta tag to access the grand parent folder name. However, you can access both via the Pascal Script rule.
The script below will prefix your files with both grand parent and parent folder names.
var
ParentFolder, GrandParentFolder: WideString;
begin
ParentFolder := WideExtractFileDir(FilePath);
GrandParentFolder := WideExtractFileDir(ParentFolder);
ParentFolder := WideExtractFileName(ParentFolder);
GrandParentFolder := WideExtractFileName(GrandParentFolder);
FileName := GrandParentFolder + '_' + ParentFolder + '_' + FileName;
end.
Offline
In v7.5.0.3 Beta, a new meta tag was added to access the grandparent folder name.
Now you can use :File_FolderName: and :File_GrandparentFolderName: meta tags to access both parent and grandparent folder names, respectively, without having to resort to a script.
Offline
Pages: 1