sc rename: new mode = l (list)

Features wanted...
Post Reply
highend
Posts: 14940
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

sc rename: new mode = l (list)

Post by highend »

Reinventing the wheel is what I normally try to avoid, so it would be cool if
the sc rename could get another mode

l = list (of items)
The parameter pattern would turn into a |- separated list of items (full paths)
and a 1:1 relationship would be assumed between the parameters itemlist and pattern

All parameters stay the same, no risk of breaking existing scripts...

This would allow mass renaming of files with XYs superb internal preview feature and automatic
increment on collision option and can easily be triggered via WM_COPYDATA from external applications.
One of my scripts helped you out? Please donate via Paypal

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

Re: sc rename: new mode = l (list)

Post by admin »

Sounds good! I'll see if it's doable...

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

Re: sc rename: new mode = l (list)

Post by admin »

Works well. Next beta... 8)

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

Re: sc rename: new mode = l (list)

Post by highend »

Thanks! :tup:
One of my scripts helped you out? Please donate via Paypal

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

Re: sc rename: new mode = l (list)

Post by highend »

Sorry Don, but this is not exactly what I meant / was looking for :ninja:
Very close, but not exactly the same :mrgreen:

It should not display the "Edit Item Names" window by default and add the
items from the parameter "pattern" in there but it should work completely silent
(as the normal rename with all its existing mode does).

The only exception to this silent mode is when the preview parameter is passed
to it (same old behavior as before).

So for example:

Code: Select all

copydata <receiving XY's hwnd>, "::rename 'l', 'R:\1bc.txt|R:\2ef.txt', , 'R:\abc.txt|R:\def.txt';", 1;
Silently rename:
R:\abc.txt -> R:\1bc.txt
R:\def.txt -> R:\2ef.txt
or

Code: Select all

copydata <receiving XY's hwnd>, "::rename 'l', 'R:\1bc.txt|R:\2ef.txt', 'p', 'R:\abc.txt|R:\def.txt';", 1;
Rename:
R:\abc.txt -> R:\1bc.txt
R:\def.txt -> R:\2ef.txt
but show the preview window before doing so (and let the user confirm if he wants the files to be renamed)
So effectively removing the displaying of the "Edit Item Names" window would turn it into what I would like to have / use...
One of my scripts helped you out? Please donate via Paypal

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

Re: sc rename: new mode = l (list)

Post by admin »

Well, I kind of thought so ... no problem, tomorrow...

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

Re: sc rename: new mode = l (list)

Post by admin »

In your samples you pass the full path in the "pattern" argument. But that's not really necessary, right?

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

Re: sc rename: new mode = l (list)

Post by highend »

Yeah, I guess it's not necessary. The "itemlist" argument already contains the full path version for all files to be renamed
so it should be sufficient that the "pattern" argument consists of only the (new) file / folder names without their path.
One of my scripts helped you out? Please donate via Paypal

Post Reply