Highlight Name Changes Bug?

Would you like Bulk Rename Utility to offer new functionality? Post your comments here!

Highlight Name Changes Bug?

Postby TheGhost78 » Sat Oct 11, 2025 5:58 am

Display Options > List > Highlight Name Changes: Use Bold and Simplify Differences

I have a Javascript Renaming script in Special (14) to remove duplicate terms that are separated by " - ".

Filename: aaaa - bbbb - bbbb - cccc - cccc - dddd - dddd - eeee
Both "cccc" terms are in orange (as if both are to be deleted, whereas only one instance is); the second "bbbb - " and the first " - dddd" terms are highlighted orange.
Ideally, this would show the second "bbbb - ", the second "cccc - " and the second "dddd - " terms in orange.

Filename: aaaa - bbbb - bbbb - cccc - dddd - dddd - eeee
The "cccc" term is highlighted orange but isn't being deleted; the second "bbbb - " and first " - dddd" terms are highlighted orange.
Ideally, this would show the second "bbbb - " and the second "dddd - " terms in orange.

Filename: aaaa - bbbb - bbbb - cccc - dddd - eeee
Only the second "bbbb - " term is highlighted orange, which is how I would expect it to look.
Last edited by TheGhost78 on Sat Oct 11, 2025 6:09 am, edited 2 times in total.
TheGhost78
 
Posts: 233
Joined: Fri Jul 19, 2024 11:25 am

Re: Highlight Name Changes Bug?

Postby TheGhost78 » Sat Oct 11, 2025 5:59 am

Javascript being used:

var parts = name.split(" - "); // split on " - "
var seen = []; // to record terms we've already added (lowercase)
var uniqueParts = []; // to collect only the first occurrences
for (var i = 0; i < parts.length; i++) {
var term = parts[i];
var termLower = term.toLowerCase(); // convert to lowercase for comparison
// if we haven't seen this term yet (case-insensitive), include it
if (seen.indexOf(termLower) === -1) {
seen.push(termLower);
uniqueParts.push(term); // keep original case for output
}
}
// reassemble without duplicates
newName = uniqueParts.join(" - ");
TheGhost78
 
Posts: 233
Joined: Fri Jul 19, 2024 11:25 am

Re: Highlight Name Changes Bug?

Postby Admin » Mon Oct 13, 2025 8:09 am

Hi, change highlighting is a straightforward before/after filename comparison. The added and removed portions may sometimes appear inconsistent with the selected criteria, but they match the rename that will be performed.
Admin
Site Admin
 
Posts: 3094
Joined: Tue Mar 08, 2005 8:39 pm

Re: Highlight Name Changes Bug?

Postby Admin » Tue Oct 21, 2025 12:26 am

If I have a file name:

EEEEAAA12, and I move the first 4 characters to the end, the resulting name is AAA12EEEE.
This can be seen in two ways:

* Remove EEEE and append it to the end
* Or move AAA12 to the start

The change highlighting has to choose one interpretation.
Currently, the highlighting is not linked to the renaming criteria that were applied. This is especially difficult to handle in cases like JavaScript-based renaming.
It simply compares the original and renamed names. In 99% of cases, this comparison matches the applied renaming rule. However, there are edge cases where it doesn't—though the rename is still technically correct.
Admin
Site Admin
 
Posts: 3094
Joined: Tue Mar 08, 2005 8:39 pm


Return to Suggestions