Super Rename Tool

Features wanted...
Netenvie
Posts: 24
Joined: 15 May 2017 10:15

Super Rename Tool

Post by Netenvie »

Hi,

Should be very cool to get a Rename tool as powerfull as the one in Total Commander.
It allow to use all your remane tools in one screen much more powerfull and easy.
Have a look at image attached.

Cheers.
Attachments
Total-commander-Rename-tool.png
Total-commander-Rename-tool.png (132.6 KiB) Viewed 4470 times

admin
Site Admin
Posts: 60563
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Super Rename Tool

Post by admin »

Well, maybe you got used to the TC one. But I'm sure XY can do the job as well.

Now, what is the job?

Netenvie
Posts: 24
Joined: 15 May 2017 10:15

Re: Super Rename Tool

Post by Netenvie »

Hi,
Yes XY do the job but i have to use 3 or 4 different functions in right click menu.
In TC all these functions are in the same windows (including regexp) and we have a preview of result.
So it's much more user friendly.

admin
Site Admin
Posts: 60563
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Super Rename Tool

Post by admin »

XY has a rename preview, too.

NS-Zero
Posts: 33
Joined: 19 Mar 2015 15:04

Re: Super Rename Tool

Post by NS-Zero »

Sorry I'm late.

I don't think the point is rename preview.
I think the point is multiple right click on context menu when want rename same list of files.
Just like Netenvie said "Yes XY do the job but i have to use 3 or 4 different functions in right click menu.".
And he want rename tools in one window.

But I think rename tools in one window will make renaming is complicated.
So i will suggest to add button "Rename Now and Then" in all rename tool windows and rename preview window. When click "Rename Now and Then" then show up the list of rename tool.
When choose a rename tool from list then XYplorer rename files and open new rename tool of new filenames.

What do you think?

admin
Site Admin
Posts: 60563
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Super Rename Tool

Post by admin »

Hm, don't know. XY has so many possibilities of mass rename and I don't see any glaring hole there at the moment. Other things are a better place to spend my time at the moment...

pleiades
Posts: 52
Joined: 13 Aug 2016 10:36

Re: Super Rename Tool

Post by pleiades »

try using xyplorer scripting feautre for renaming, its very good :tup:

NS-Zero
Posts: 33
Joined: 19 Mar 2015 15:04

Re: Super Rename Tool

Post by NS-Zero »

Just a idea. :whistle:

SpiroC
Posts: 14
Joined: 01 Dec 2017 23:20

Re: Super Rename Tool

Post by SpiroC »

Hi.
New XYplorer user here but I was scripting in Directory Opus for 4 years and Multi Commander for about 1 year before this. So far it's been fantastic. A lot of my little one liner scripts are no longer required because functions are already supported natively (tab manipulation, settings toggling), and I'm also finding that all my scripts are much shorter (30%-70%) because things are handled better (selection errors, rename conflicts, missing network paths, etc) natively.

I think the point here is very much the Rename Preview functionality. If I have a script with a common set of custom rename operations, it's no problem at all if I don't need a preview window. I just put them sequentially in a script but then I have to hunt for the changed filenames in the list to see if there was any unexpected behavior. But I'm looking for a way to do multiple custom rename operations on say a list of TV show names. eg replace some chars, following by proper case, followed by some key acronym capitalization adjustments, followed by partial filename copy to clipboard. But I also want to preview the outcome of all the rename operations before proceeding. Is there a recommended way to do this?

I was thinking maybe I could retrieve a list of selected filenames, do all the manipulations using regex's on the string list and then write them back. But I can't find any way to "rename selected files using clipboard with preview". I can use a Foreach loop to do the rename but again the preview is missing. In Multi Commander I ended up writing my own popup confirmation window but it was messy, ugly and no undo. In DO it was possible but again the scripts were long and messy and too many languages supported with not enough documentation for any of them. I found myself constantly relying on sample code and forums (yes I see the irony of asking for help here). I have seen also in the forums that you can push the name list out to an AutoIT script but again that's the kind of messy I was hoping to avoid. Everything else in XYplorer so far has been so much cleaner.

highend
Posts: 13313
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Super Rename Tool

Post by highend »

There is no way to achieve this (in a non-messy way). Displaying a text window with all
original names + names after the operation is not a problem but you'd need an additional
confirmation window afterwards -> messy...

There is no way to use the script command rename with more than one pattern either.

One solution: Let XY write 2 .txt files, one with the original names, another with
your modified ones. Start the external tool (code it...), let it read both files, display it in the same way
as the rename preview does it. 2 .txt files because I've never tested the limitations
of e.g. WM_COPYDATA and how much data it can actually handle :mrgreen:

I personally don't find this so messy but your mileage may vary ofc...

The only way to handle it via XYplorer would be a change to the rename script command itself.
A new mode: Let's call it x for eXchange
With that new mode used, <pattern> would accept a list of item names (the ones your script
modified via regexreplaces, etc.), while <itemlist> still refers to the selection in the pane
(or a |-separated list)...

If Don wants to implement that? Write a feature request here in the forum...
One of my scripts helped you out? Please donate via Paypal

SpiroC
Posts: 14
Joined: 01 Dec 2017 23:20

Re: Super Rename Tool

Post by SpiroC »

Hi,
Thanks for the reply. Yes it would require rename scripting command to accept a "targetnameslist" as the "pattern" parameter. One current workaround is to put the new filename list into the clipboard and then launch Rename Special -> Edit Item Names (#147;). After that it's a manual "Select All", "Paste". Another idea I had was to use the lister itself to preview the new names by poking them into a custom tag or comment or custom column. A second script could run through an apply the tag to the filenames. Just about to start toying with that now. I will do some more reading and make a feature request, thanks. SpiroC

bdeshi
Posts: 4249
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612 / Dhaka
Contact:

Re: Super Rename Tool

Post by bdeshi »

Netenvie wrote:It allow to use all your remane tools in one screen much more powerfull and easy.
I think that's good idea. A all-in-one rename dialog with maybe a dropdown at the top to choose between renaming modes (batch/regexp ... ). But it's probably going to be a complex task, consolidating all the various renaming operations into one dialog. Anyway, a good idea yet.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

highend
Posts: 13313
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Super Rename Tool

Post by highend »

Another idea I had was to use the lister itself to preview the new names by poking them into a custom tag or comment or custom column
Don't waste your time on this. While this would work for a few files, do NOT try this when you are about to do that with a LOT of files. tagitems()
in a foreach loop is just not fast enough for this...
One of my scripts helped you out? Please donate via Paypal

SpiroC
Posts: 14
Joined: 01 Dec 2017 23:20

Re: Super Rename Tool

Post by SpiroC »

@highend
So your idea about 2 txt files is working pretty well for me at the moment. This script writes 2 txt files, original names, modified names after as many changes as you wish, then pops up Beyond Compare for visual check (and even edit), lastly asks for confirmation before going ahead and renaming all the files. First cut. Confirmation is ugly. Haven't found any Yes/No box yet.

"Multi Rename via txt files, using Beyond Compare for verification"
global $gstartindex = 0, $gendindex = 0, $gnewname, $gnewnameslist;
$selectedlist = get("SelectedItemsNames", "<crlf>");
writefile("<xydata>\_selectedfiles.txt", $selectedlist);
writefile("<xydata>\_newnames.txt", "", o);
$count = 1;
foreach($file, $selectedlist, "<crlf>") {

// all rename operations done on variable $file
// ******************************************

//$file = "newfile$count.txt";

$base = getpathcomponent($file, "base");
$base = regexreplace($base, "[_\.]+", " ");
$base = recase($base, "t");
$ext = getpathcomponent($file, "ext");
$ext = recase($ext, l);
$file = "$base.$ext";

// ******************************************

writefile("<xydata>\_newnames.txt", "$file<crlf>", a);
$count++;
}
run '"C:\_Portable\_Beyond Compare\BCompare.exe" "_selectedfiles.txt" "_newnames.txt"', <xydata>, 2;
//$confirm = popupmenu("Proceed with rename;1|Cancel rename;0");
$confirm = inputselect("Proceed with rename", "Yes|No",,192);
if ($confirm == 1) {
//echo "You selected confirm";
$gnewnameslist = readfile("<xydata>\_newnames.txt");
$selectedlistpaths = get("SelectedItemsPathNames", "<crlf>");
foreach($filepath, $selectedlistpaths, "<crlf>") {
findnextname();
renameitem("$gnewname", "$filepath", 4);
}
}
else
{
echo "Rename cancelled by user. Aborting";
}

function findnextname() {
global $gstartindex, $gendindex, $gnewname, $gnewnameslist;
$gendindex = strpos($gnewnameslist, "<crlf>", $gstartindex);
$gnewname = substr($gnewnameslist, $gstartindex, $gendindex);
$gnewname = trim($gnewname, "<cr><lf><crlf>");
$gstartindex = $gendindex+2;
}

highend
Posts: 13313
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Super Rename Tool

Post by highend »

Haven't found any Yes/No box yet
The script command

Code: Select all

msg
does that

Not everybody owns Beyond Compare... :wink:

And please, put code tags around any scripting code you post :mrgreen:
One of my scripts helped you out? Please donate via Paypal

Post Reply