"Match: New name" not working correctly
Hello,
I've encountered an issue with the condition feature in Advanced Renamer 4.19.
- Batch mode: Rename
- New name pattern: <Img DateOriginal:yyyy-mm-dd> <Img TimeOriginal:hh-nn-ss> <Inc Nr:1>
- Apply to: Name
- Condition (if): "Apply condition" → Match: New name / Starts with / Pattern: 2025-
- "Not matching" checkbox: unchecked
Expected behavior:
Files should only be renamed if the new name starts with "2025-". Files without EXIF date (where the new name would be just "0041", "0042", etc.) should be ignored and keep their current names.
Actual behavior:
Files without EXIF date ARE renamed to just the incremental number (e.g., "0041"), even though "0041" does NOT start with "2025-" and should not match the condition.
Example:
- Current filename: "2025-01-31 01-53-00.JPG"
No EXIF date in this file
- New name becomes: "0007" (just the increment number)
It seems the condition is not working properly - files that don't match should be skipped entirely, not renamed with a partially filled template. This happens with both JPG and PNG files.
Is this a known bug, or am I misunderstanding how the condition should work?
Thanks!
I've encountered an issue with the condition feature in Advanced Renamer 4.19.
- Batch mode: Rename
- New name pattern: <Img DateOriginal:yyyy-mm-dd> <Img TimeOriginal:hh-nn-ss> <Inc Nr:1>
- Apply to: Name
- Condition (if): "Apply condition" → Match: New name / Starts with / Pattern: 2025-
- "Not matching" checkbox: unchecked
Expected behavior:
Files should only be renamed if the new name starts with "2025-". Files without EXIF date (where the new name would be just "0041", "0042", etc.) should be ignored and keep their current names.
Actual behavior:
Files without EXIF date ARE renamed to just the incremental number (e.g., "0041"), even though "0041" does NOT start with "2025-" and should not match the condition.
Example:
- Current filename: "2025-01-31 01-53-00.JPG"
No EXIF date in this file
- New name becomes: "0007" (just the increment number)
It seems the condition is not working properly - files that don't match should be skipped entirely, not renamed with a partially filled template. This happens with both JPG and PNG files.
Is this a known bug, or am I misunderstanding how the condition should work?
Thanks!
Hi Andrey,
I don't really use the {if} conditionals, but assuming that's your first method in the method list, I'm thinking (maybe) the {if} gets applied before the *actual* new name method takes effect. In that case the if would fire on whatever comes in to the new name method, and anything in that method gets executed, in effect, on the old filename (assuming no methods before it that changed the name).
Just a guess, but seems logical to me somehow. In programming you'd be starting a program with
if (newname == "2025-" ) {
...
} // (endif)
... whatever's inside the if module won't get executed ever, because there is no "newname".
Try putting something before the method that actually changes the name first.
Just a guess, by the way.
Best,
DF
I don't really use the {if} conditionals, but assuming that's your first method in the method list, I'm thinking (maybe) the {if} gets applied before the *actual* new name method takes effect. In that case the if would fire on whatever comes in to the new name method, and anything in that method gets executed, in effect, on the old filename (assuming no methods before it that changed the name).
Just a guess, but seems logical to me somehow. In programming you'd be starting a program with
if (newname == "2025-" ) {
...
} // (endif)
... whatever's inside the if module won't get executed ever, because there is no "newname".
Try putting something before the method that actually changes the name first.
Just a guess, by the way.
Best,
DF
Reply to #2:
Thanks for your response!
Could you clarify what you mean by 'putting something before the method'? Should I add another rename method above this one? I'm not sure how that would help since I'm using 'Match: New name' which should check the result of the current method."
I understand your logic, but I think the "Apply condition" feature works differently. The option to choose between "Name" (old filename) and "New name" suggests that the condition is evaluated after the pattern is generated but before the actual rename operation.
My understanding:
1) Advanced Renamer generates the new name from the pattern for each file
2) The condition checks if this generated new name matches the criteria
3) Only if it matches, the rename is applied; otherwise, the file keeps its current name
So when I select:
- Match: New name
- Starts with: "2025-"
The program should:
1) Generate new name from pattern <Img DateOriginal:yyyy-mm-dd>...
For files without EXIF date → new name = 0007 (just the increment)
2) Check: does 0007 start with 2025-? → NO
3) Action: Skip renaming, keep current filename
But instead, it renames the file to 0007 anyway, which seems like a bug.
If the condition was meant to filter the input (old names), there wouldn't be a "New name" option at all—only "Name" would make sense.
Does this make sense?
Best,
Andrey
Thanks for your response!
Could you clarify what you mean by 'putting something before the method'? Should I add another rename method above this one? I'm not sure how that would help since I'm using 'Match: New name' which should check the result of the current method."
I understand your logic, but I think the "Apply condition" feature works differently. The option to choose between "Name" (old filename) and "New name" suggests that the condition is evaluated after the pattern is generated but before the actual rename operation.
My understanding:
1) Advanced Renamer generates the new name from the pattern for each file
2) The condition checks if this generated new name matches the criteria
3) Only if it matches, the rename is applied; otherwise, the file keeps its current name
So when I select:
- Match: New name
- Starts with: "2025-"
The program should:
1) Generate new name from pattern <Img DateOriginal:yyyy-mm-dd>...
For files without EXIF date → new name = 0007 (just the increment)
2) Check: does 0007 start with 2025-? → NO
3) Action: Skip renaming, keep current filename
But instead, it renames the file to 0007 anyway, which seems like a bug.
If the condition was meant to filter the input (old names), there wouldn't be a "New name" option at all—only "Name" would make sense.
Does this make sense?
Best,
Andrey
Reply to #3:
Andrey,
I get what you're saying, it just depends on when the {if} fires.
I *think* it fires before the method is applied, or not applied, but as I said that's just a guess. In testing it *seems* to be the case for me. I'm just saying, add something that actually changes the filename so that "new name" coming INTO the New Name method is different, and see if that changes your outcome.
It makes sense from a programming standpoint, as I implied, but Kim will have to clarify. The user manual does say:
New name The new filename of the file without the extension part. It is the new name the file has at the moment when the condition is evaluated. If multiple methods is used and the condition is applied to method #4, New Name is the name of the file after method #3 has been executed.
"after method #3 has been executed", not after method #4 has been evaluated. (this is under "Using Advanced Renamer / Batch method conditions)
Best,
DF
Andrey,
I get what you're saying, it just depends on when the {if} fires.
I *think* it fires before the method is applied, or not applied, but as I said that's just a guess. In testing it *seems* to be the case for me. I'm just saying, add something that actually changes the filename so that "new name" coming INTO the New Name method is different, and see if that changes your outcome.
It makes sense from a programming standpoint, as I implied, but Kim will have to clarify. The user manual does say:
New name The new filename of the file without the extension part. It is the new name the file has at the moment when the condition is evaluated. If multiple methods is used and the condition is applied to method #4, New Name is the name of the file after method #3 has been executed.
"after method #3 has been executed", not after method #4 has been evaluated. (this is under "Using Advanced Renamer / Batch method conditions)
Best,
DF
Reply to #1:
This is the same answer I gave you by email.
The "New name" field only makes sense when you have multiple methods in your batch. The if-condition is applied before the batch method is evaluated, which means the value of the New Name field will be the value before evaluating the method.
Instead you can add a additional New Name method and set the if-condition on that one instead. Set the New Name pattern of the method to <Name> and configure the condition like this:
Field: New name
Match: Starts with
Pattern: space
The second method will revert name to the original when the new name starts with a space.
This is the same answer I gave you by email.
The "New name" field only makes sense when you have multiple methods in your batch. The if-condition is applied before the batch method is evaluated, which means the value of the New Name field will be the value before evaluating the method.
Instead you can add a additional New Name method and set the if-condition on that one instead. Set the New Name pattern of the method to <Name> and configure the condition like this:
Field: New name
Match: Starts with
Pattern: space
The second method will revert name to the original when the new name starts with a space.
Reply to #2:
DF: That is exactly how the logic is. The if condition is always applied before the batch method. You cannot use the if-condition to evaluate the result of the method after evaluation. That will have to be done in a batch method later in the sequence.
DF: That is exactly how the logic is. The if condition is always applied before the batch method. You cannot use the if-condition to evaluate the result of the method after evaluation. That will have to be done in a batch method later in the sequence.
Reply to #6:
Thank you so much, Kim and DF, for the detailed explanations! Everything is clear now. Really appreciate your help!
Thank you so much, Kim and DF, for the detailed explanations! Everything is clear now. Really appreciate your help!