Conditional Renaming Method

Advanced Renamer forum
#1 : 31/07-19 17:34
Posts: 2
I would like to rename my files based on the tags available to me. IE

If (<Img Year>-<Img Month>-<Img Day>_<Img Hour>_<Img Sec>) <>""
then rename <Img Year>-<Img Month>-<Img Day>_<Img Hour>_<Img Sec>_<Inc NrDir:0001>
else if ( <Year Created>-<Month Created>-<Day Created>_<Hour Created>_<Min Created> <> ""
then rename <Year Created>-<Month Created>-<Day Created>_<Hour Created>_<Min Created>_<Inc NrDir:0001>
else <Year Modified>-<Month Modified>-<Day Modified>_<Hour Modified>_<Min Modified>_<Inc NrDir:0001>

Right now i am running the three methods each using filters and sorts

I would like to create this method and call it from a Powershell script to recurse through my collection.


31/07-19 17:34
#2 : 31/07-19 18:09
David Lee
David Lee
Posts: 444
Reply to #1:
Have you considered ARen's Script method (JavaScript), using app.parseTags()?

31/07-19 18:09
#3 : 01/08-19 03:40
Posts: 2
Reply to #2:
I have, but i was hoping there was some embedded function to chain Methods together and give them a priority . Also using the Aren scripting means i would need to make 3 passes of the same source folder where doing them conditionally would mean only one pass and also keep auto numbering etc in tact.
The only way i can see doing this now is to use the Java script method and recreate the New Name method in code, including the duplicate Exifdata check and apply my 3 checks each of my conditions. Very doable but not ideal.

01/08-19 03:40 - edited 01/08-19 03:45
#4 : 13/10-19 00:21
Posts: 1
Reply to #3:
John, have you managed to write such JS script? I've never wrote JS code, so it would be great to see a good example from you.

My case is: I've got three kinds of files in my folder.
1. Images taken with camera app. Such files have proper date set at tags.
2. Video files. They've got another tags with proper data.
3. Images taken with side app, like telegram. These files don't have any camera-specific data.
So now I have to use this kind of add method:
<Img Year><Video Date Year>-<Img Month><Video Date Month>-<Img Day><Video Date Day>-
But obviously it doesn't work for files from point #3.
First I thought Advanced Renamer has conditional renaming as a built-in feature, now I see it's not, and it looks really weird for me. I'm sure people already wrote a ton of scripts that can be used in this app, so some kind of scripts library would be an awesome thing.

13/10-19 00:21