Rename a folder using the name of the video file inside it – ExifTool issue in v4.29
Hello,
I would like to rename folders using the name of the video file contained inside each folder.
For example:
- Folder name: `Blue`
- File inside the folder: `Red.mp4`
- Expected new folder name: `Red`
I used to accomplish this successfully with Advanced Renamer 3.88 using a Pattern List with two methods:
**Method 1 – New Name:**
`<ExifTool:FileName>`
**Method 2 – Replace (Regular Expression):**
- Search: `(.*)(\.)(.*)`
- Replace: `\1`
However, this no longer works in Advanced Renamer 4.x.
I have tested versions 4.27 and 4.29, selecting only the folder (not the video file) in Folder Renaming mode.
The program displays the following error:
`Filename not specified`
I also tested `<ExifTool:FileName>` directly on the video file itself. In that case, Advanced Renamer returns `Red.mp4`, but automatically appends the original extension, resulting in `Red.mp4.mp4`.
My questions are:
1. Is it still possible to retrieve the name of a file contained inside a selected folder using ExifTool in Advanced Renamer 4.x?
2. Has the behaviour of `<ExifTool:FileName>` changed since version 3.88?
3. Is there a way to accomplish this directly in Folder Renaming mode, without moving the files or creating new folders?
4. If this is no longer possible using the standard methods, could you provide a working JavaScript solution?
I would like to preserve the original folder structure and only rename each folder according to the name of its video file. The video files and subtitle files must remain untouched and in their original locations.
Thank you!
I would like to rename folders using the name of the video file contained inside each folder.
For example:
- Folder name: `Blue`
- File inside the folder: `Red.mp4`
- Expected new folder name: `Red`
I used to accomplish this successfully with Advanced Renamer 3.88 using a Pattern List with two methods:
**Method 1 – New Name:**
`<ExifTool:FileName>`
**Method 2 – Replace (Regular Expression):**
- Search: `(.*)(\.)(.*)`
- Replace: `\1`
However, this no longer works in Advanced Renamer 4.x.
I have tested versions 4.27 and 4.29, selecting only the folder (not the video file) in Folder Renaming mode.
The program displays the following error:
`Filename not specified`
I also tested `<ExifTool:FileName>` directly on the video file itself. In that case, Advanced Renamer returns `Red.mp4`, but automatically appends the original extension, resulting in `Red.mp4.mp4`.
My questions are:
1. Is it still possible to retrieve the name of a file contained inside a selected folder using ExifTool in Advanced Renamer 4.x?
2. Has the behaviour of `<ExifTool:FileName>` changed since version 3.88?
3. Is there a way to accomplish this directly in Folder Renaming mode, without moving the files or creating new folders?
4. If this is no longer possible using the standard methods, could you provide a working JavaScript solution?
I would like to preserve the original folder structure and only rename each folder according to the name of its video file. The video files and subtitle files must remain untouched and in their original locations.
Thank you!
Reply to #1:
Welcome Mario!
Odd thing is that your method still works in Aren 3.95. But it's flaky as hell and if you have more than one eligible file in the folder, even more so.
You can still get version 3.95 if you contact support (or elsewhere) But I don't recommend it.
As for the latest versions of Aren, I currently don't see a way to do this eloquently. I can do it in two or three passes of Aren -- which could be rolled into one batch file.
Or just skip that and do it with a relatively simple PowerShell or Python script.
Perhaps one of the other forumites can work out something neater.
What OS are you using?
Regards,
Randy
ETA. The following feature request would make solving your problem so much easier.
Please go to https://advancedrenamer.fider.io/posts/4/js-love
and up-vote it.
Welcome Mario!
Odd thing is that your method still works in Aren 3.95. But it's flaky as hell and if you have more than one eligible file in the folder, even more so.
You can still get version 3.95 if you contact support (or elsewhere) But I don't recommend it.
As for the latest versions of Aren, I currently don't see a way to do this eloquently. I can do it in two or three passes of Aren -- which could be rolled into one batch file.
Or just skip that and do it with a relatively simple PowerShell or Python script.
Perhaps one of the other forumites can work out something neater.
What OS are you using?
Regards,
Randy
ETA. The following feature request would make solving your problem so much easier.
Please go to https://advancedrenamer.fider.io/posts/4/js-love
and up-vote it.