Page 1 of 1

sc rename: new mode = l (list)

Posted: 09 Apr 2018 10:39
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.

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

Posted: 11 Apr 2018 13:41
by admin
Sounds good! I'll see if it's doable...

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

Posted: 11 Apr 2018 16:32
by admin
Works well. Next beta... 8)

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

Posted: 11 Apr 2018 16:44
by highend
Thanks! :tup:

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

Posted: 11 Apr 2018 21:41
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...

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

Posted: 11 Apr 2018 21:47
by admin
Well, I kind of thought so ... no problem, tomorrow...

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

Posted: 12 Apr 2018 09:36
by admin
In your samples you pass the full path in the "pattern" argument. But that's not really necessary, right?

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

Posted: 12 Apr 2018 09:46
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.